* [PR PATCH] gtk4: fix grabbing X11 check window before 15s after boot
@ 2024-04-16 20:47 oreo639
2024-04-16 20:48 ` [PR PATCH] [Updated] " oreo639
2024-04-17 5:57 ` [PR PATCH] [Merged]: " oreo639
0 siblings, 2 replies; 3+ messages in thread
From: oreo639 @ 2024-04-16 20:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]
There is a new pull request by oreo639 against master on the void-packages repository
https://github.com/oreo639/void-packages gtk4-fix
https://github.com/void-linux/void-packages/pull/49869
gtk4: fix grabbing X11 check window before 15s after boot
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**
Fixes: #49575
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/49869.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gtk4-fix-49869.patch --]
[-- Type: text/x-diff, Size: 4152 bytes --]
From d00353f2178461eaa9be6645cc7f0b7cbf27685d Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 16 Apr 2024 13:45:41 -0700
Subject: [PATCH] gtk4: fix grabbing X11 check window before 15s after boot
---
srcpkgs/gtk4/patches/wmspec.patch | 85 +++++++++++++++++++++++++++++++
srcpkgs/gtk4/template | 2 +-
2 files changed, 86 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/gtk4/patches/wmspec.patch
diff --git a/srcpkgs/gtk4/patches/wmspec.patch b/srcpkgs/gtk4/patches/wmspec.patch
new file mode 100644
index 00000000000000..0eabcf5411412e
--- /dev/null
+++ b/srcpkgs/gtk4/patches/wmspec.patch
@@ -0,0 +1,85 @@
+From ab33b56ec95b1867cc44808d60caddaf67887ba7 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 16 Apr 2024 12:35:00 -0700
+Subject: [PATCH] x11: Remove last_wmspec_check_time
+
+In fetch_net_wm_check_window(), before updating the wmspec_check_window, a
+check is performed to verify a 15s difference between last_wmspec_check_time
+and the current monotonic time.
+
+The comment suggests that this check is done to ensure that it doesn't check
+for a new check window repeatedly over and over again. While that was the case
+origionally, currently the last_wmspec_check_time only gets updated when
+wmspec_check_window is set, which is already checked earlier, making the time
+check useless.
+
+This check causes issues on cold boots where gtk4 applications are not able
+to obtain the wmspec_check_window until 15 seconds after boot, making gtk
+unable to check for extended wm_hints during that time.
+
+Fixes: #6558
+---
+ gdk/x11/gdkdisplay-x11.c | 1 -
+ gdk/x11/gdkscreen-x11.c | 7 -------
+ gdk/x11/gdkscreen-x11.h | 1 -
+ 3 files changed, 9 deletions(-)
+
+diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
+index efd5107c52d..4e24acc33bb 100644
+--- a/gdk/x11/gdkdisplay-x11.c
++++ b/gdk/x11/gdkdisplay-x11.c
+@@ -665,7 +665,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
+ if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window)
+ {
+ x11_screen->wmspec_check_window = None;
+- x11_screen->last_wmspec_check_time = 0;
+ g_free (x11_screen->window_manager_name);
+ x11_screen->window_manager_name = g_strdup ("unknown");
+
+diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
+index 2456f14b29d..c0584b2d591 100644
+--- a/gdk/x11/gdkscreen-x11.c
++++ b/gdk/x11/gdkscreen-x11.c
+@@ -1145,7 +1145,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
+ {
+ GdkDisplay *display;
+ Window window;
+- guint64 now;
+ int error;
+
+ display = x11_screen->display;
+@@ -1155,11 +1154,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
+ if (x11_screen->wmspec_check_window != None)
+ return; /* already have it */
+
+- now = g_get_monotonic_time ();
+-
+- if ((now - x11_screen->last_wmspec_check_time) / 1e6 < 15)
+- return; /* we've checked recently */
+-
+ window = get_net_supporting_wm_check (x11_screen, x11_screen->xroot_window);
+ if (window == None)
+ return;
+@@ -1184,7 +1178,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
+ return;
+
+ x11_screen->wmspec_check_window = window;
+- x11_screen->last_wmspec_check_time = now;
+ x11_screen->need_refetch_net_supported = TRUE;
+ x11_screen->need_refetch_wm_name = TRUE;
+
+diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
+index d3775b23e51..bfd014997ba 100644
+--- a/gdk/x11/gdkscreen-x11.h
++++ b/gdk/x11/gdkscreen-x11.h
+@@ -48,7 +48,6 @@ struct _GdkX11Screen
+ int xft_dpi;
+
+ /* Window manager */
+- gint64 last_wmspec_check_time;
+ Window wmspec_check_window;
+ char *window_manager_name;
+
+--
+GitLab
+
diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 10dcbbd0526e0d..050b6a14aa117a 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
# Template file for 'gtk4'
pkgname=gtk4
version=4.14.2
-revision=2
+revision=3
build_style=meson
build_helper="gir"
configure_args="-Dman-pages=true -Ddocumentation=true -Dbuild-tests=false
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PR PATCH] [Updated] gtk4: fix grabbing X11 check window before 15s after boot
2024-04-16 20:47 [PR PATCH] gtk4: fix grabbing X11 check window before 15s after boot oreo639
@ 2024-04-16 20:48 ` oreo639
2024-04-17 5:57 ` [PR PATCH] [Merged]: " oreo639
1 sibling, 0 replies; 3+ messages in thread
From: oreo639 @ 2024-04-16 20:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]
There is an updated pull request by oreo639 against master on the void-packages repository
https://github.com/oreo639/void-packages gtk4-fix
https://github.com/void-linux/void-packages/pull/49869
gtk4: fix grabbing X11 check window before 15s after boot
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**
Fixes: #49575
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/49869.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gtk4-fix-49869.patch --]
[-- Type: text/x-diff, Size: 4211 bytes --]
From 2fca473d93a8f37a74c5febea90c553b35237116 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 16 Apr 2024 13:45:41 -0700
Subject: [PATCH] gtk4: fix grabbing X11 check window before 15s after boot
The check window is necessary to obtain extended wm hints.
---
srcpkgs/gtk4/patches/wmspec.patch | 85 +++++++++++++++++++++++++++++++
srcpkgs/gtk4/template | 2 +-
2 files changed, 86 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/gtk4/patches/wmspec.patch
diff --git a/srcpkgs/gtk4/patches/wmspec.patch b/srcpkgs/gtk4/patches/wmspec.patch
new file mode 100644
index 00000000000000..0eabcf5411412e
--- /dev/null
+++ b/srcpkgs/gtk4/patches/wmspec.patch
@@ -0,0 +1,85 @@
+From ab33b56ec95b1867cc44808d60caddaf67887ba7 Mon Sep 17 00:00:00 2001
+From: oreo639 <oreo6391@gmail.com>
+Date: Tue, 16 Apr 2024 12:35:00 -0700
+Subject: [PATCH] x11: Remove last_wmspec_check_time
+
+In fetch_net_wm_check_window(), before updating the wmspec_check_window, a
+check is performed to verify a 15s difference between last_wmspec_check_time
+and the current monotonic time.
+
+The comment suggests that this check is done to ensure that it doesn't check
+for a new check window repeatedly over and over again. While that was the case
+origionally, currently the last_wmspec_check_time only gets updated when
+wmspec_check_window is set, which is already checked earlier, making the time
+check useless.
+
+This check causes issues on cold boots where gtk4 applications are not able
+to obtain the wmspec_check_window until 15 seconds after boot, making gtk
+unable to check for extended wm_hints during that time.
+
+Fixes: #6558
+---
+ gdk/x11/gdkdisplay-x11.c | 1 -
+ gdk/x11/gdkscreen-x11.c | 7 -------
+ gdk/x11/gdkscreen-x11.h | 1 -
+ 3 files changed, 9 deletions(-)
+
+diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
+index efd5107c52d..4e24acc33bb 100644
+--- a/gdk/x11/gdkdisplay-x11.c
++++ b/gdk/x11/gdkdisplay-x11.c
+@@ -665,7 +665,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
+ if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window)
+ {
+ x11_screen->wmspec_check_window = None;
+- x11_screen->last_wmspec_check_time = 0;
+ g_free (x11_screen->window_manager_name);
+ x11_screen->window_manager_name = g_strdup ("unknown");
+
+diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
+index 2456f14b29d..c0584b2d591 100644
+--- a/gdk/x11/gdkscreen-x11.c
++++ b/gdk/x11/gdkscreen-x11.c
+@@ -1145,7 +1145,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
+ {
+ GdkDisplay *display;
+ Window window;
+- guint64 now;
+ int error;
+
+ display = x11_screen->display;
+@@ -1155,11 +1154,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
+ if (x11_screen->wmspec_check_window != None)
+ return; /* already have it */
+
+- now = g_get_monotonic_time ();
+-
+- if ((now - x11_screen->last_wmspec_check_time) / 1e6 < 15)
+- return; /* we've checked recently */
+-
+ window = get_net_supporting_wm_check (x11_screen, x11_screen->xroot_window);
+ if (window == None)
+ return;
+@@ -1184,7 +1178,6 @@ fetch_net_wm_check_window (GdkX11Screen *x11_screen)
+ return;
+
+ x11_screen->wmspec_check_window = window;
+- x11_screen->last_wmspec_check_time = now;
+ x11_screen->need_refetch_net_supported = TRUE;
+ x11_screen->need_refetch_wm_name = TRUE;
+
+diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
+index d3775b23e51..bfd014997ba 100644
+--- a/gdk/x11/gdkscreen-x11.h
++++ b/gdk/x11/gdkscreen-x11.h
+@@ -48,7 +48,6 @@ struct _GdkX11Screen
+ int xft_dpi;
+
+ /* Window manager */
+- gint64 last_wmspec_check_time;
+ Window wmspec_check_window;
+ char *window_manager_name;
+
+--
+GitLab
+
diff --git a/srcpkgs/gtk4/template b/srcpkgs/gtk4/template
index 10dcbbd0526e0d..050b6a14aa117a 100644
--- a/srcpkgs/gtk4/template
+++ b/srcpkgs/gtk4/template
@@ -1,7 +1,7 @@
# Template file for 'gtk4'
pkgname=gtk4
version=4.14.2
-revision=2
+revision=3
build_style=meson
build_helper="gir"
configure_args="-Dman-pages=true -Ddocumentation=true -Dbuild-tests=false
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PR PATCH] [Merged]: gtk4: fix grabbing X11 check window before 15s after boot
2024-04-16 20:47 [PR PATCH] gtk4: fix grabbing X11 check window before 15s after boot oreo639
2024-04-16 20:48 ` [PR PATCH] [Updated] " oreo639
@ 2024-04-17 5:57 ` oreo639
1 sibling, 0 replies; 3+ messages in thread
From: oreo639 @ 2024-04-17 5:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]
There's a merged pull request on the void-packages repository
gtk4: fix grabbing X11 check window before 15s after boot
https://github.com/void-linux/void-packages/pull/49869
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
Fixes: #49575
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-17 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 20:47 [PR PATCH] gtk4: fix grabbing X11 check window before 15s after boot oreo639
2024-04-16 20:48 ` [PR PATCH] [Updated] " oreo639
2024-04-17 5:57 ` [PR PATCH] [Merged]: " oreo639
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).