From 85a67b0eeebc5ebf7038da3be407942b06efcbb2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 25 Aug 2023 06:39:05 +0000 Subject: Fix [e42eef33ee]: valgrind complains at wish startup (input methods). Patch from John Goodward. --- unix/tkUnixEvent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index 9fe28b5..4cdde86 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -175,11 +175,15 @@ TkpOpenDisplay( if (display == NULL) { return NULL; } + dispPtr = ckalloc(sizeof(TkDisplay)); memset(dispPtr, 0, sizeof(TkDisplay)); dispPtr->display = display; dispPtr->flags |= use_xkb; #ifdef TK_USE_INPUT_METHODS + if (XSetLocaleModifiers("") == NULL) { + return; + } OpenIM(dispPtr); XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL, InstantiateIMCallback, (XPointer) dispPtr); @@ -743,10 +747,6 @@ OpenIM( XIMStyles *stylePtr; XIMStyle bestStyle = 0; - if (XSetLocaleModifiers("") == NULL) { - return; - } - ++dispPtr->ximGeneration; dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL); if (dispPtr->inputMethod == NULL) { -- cgit v0.12 From 9fbe66d495e70c436818983a72c8a05e8556897b Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 25 Aug 2023 06:40:17 +0000 Subject: Let branch bug-e42eef33ee build at Github for Linux (temporary commit). --- .github/workflows/linux-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 55797bf..6fb4169 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -4,6 +4,7 @@ on: branches: - "main" - "core-8-6-branch" + - bug-e42eef33ee tags: - "core-**" permissions: -- cgit v0.12 From 168bf14c83f7386e326a879252d443483f4a9502 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 25 Aug 2023 06:41:15 +0000 Subject: Remove unintended line space. --- unix/tkUnixEvent.c | 1 - 1 file changed, 1 deletion(-) diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index 4cdde86..fc6d699 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -175,7 +175,6 @@ TkpOpenDisplay( if (display == NULL) { return NULL; } - dispPtr = ckalloc(sizeof(TkDisplay)); memset(dispPtr, 0, sizeof(TkDisplay)); dispPtr->display = display; -- cgit v0.12 From 042a99280ea10e5461012d9665210544ff4a7989 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 25 Aug 2023 15:58:09 +0000 Subject: Really let branch bug-e42eef33ee build at Github for Linux (temporary commit). --- .github/workflows/linux-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 6fb4169..48ebbf1 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -4,7 +4,7 @@ on: branches: - "main" - "core-8-6-branch" - - bug-e42eef33ee + - "bug-e42eef33ee" tags: - "core-**" permissions: -- cgit v0.12 From e28f8c1f992fb082fd50e6ec60dd53e7d8655514 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 26 Aug 2023 08:42:41 +0000 Subject: Make it build, and make it a better fix (no leak). --- unix/tkUnixEvent.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index fc6d699..5e8cf7c 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -175,14 +175,16 @@ TkpOpenDisplay( if (display == NULL) { return NULL; } +#ifdef TK_USE_INPUT_METHODS + if (XSetLocaleModifiers("") == NULL) { + return NULL; + } +#endif dispPtr = ckalloc(sizeof(TkDisplay)); memset(dispPtr, 0, sizeof(TkDisplay)); dispPtr->display = display; dispPtr->flags |= use_xkb; #ifdef TK_USE_INPUT_METHODS - if (XSetLocaleModifiers("") == NULL) { - return; - } OpenIM(dispPtr); XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL, InstantiateIMCallback, (XPointer) dispPtr); -- cgit v0.12 From 54814ce6ece9edafe68f88c8a9b0dcec34a084c7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 28 Aug 2023 17:40:26 +0000 Subject: Ignore the return value of XSetLocaleModifiers(). --- unix/tkUnixEvent.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index 5e8cf7c..911a07c 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -175,16 +175,12 @@ TkpOpenDisplay( if (display == NULL) { return NULL; } -#ifdef TK_USE_INPUT_METHODS - if (XSetLocaleModifiers("") == NULL) { - return NULL; - } -#endif dispPtr = ckalloc(sizeof(TkDisplay)); memset(dispPtr, 0, sizeof(TkDisplay)); dispPtr->display = display; dispPtr->flags |= use_xkb; #ifdef TK_USE_INPUT_METHODS + XSetLocaleModifiers(""); OpenIM(dispPtr); XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL, InstantiateIMCallback, (XPointer) dispPtr); -- cgit v0.12 From cd9b4fdc247a60b7fa789ee617b4e2dea03c536e Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 29 Aug 2023 19:24:39 +0000 Subject: Backout temporary commits. --- .github/workflows/linux-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 48ebbf1..55797bf 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -4,7 +4,6 @@ on: branches: - "main" - "core-8-6-branch" - - "bug-e42eef33ee" tags: - "core-**" permissions: -- cgit v0.12