[gtk/present-toplevel-2: 65/79] x11: Set type hints based on surface type
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/present-toplevel-2: 65/79] x11: Set type hints based on surface type
- Date: Mon, 9 Mar 2020 15:37:02 +0000 (UTC)
commit 8c74e01186aa4bcfb06e53996a34aa2b22a80bcc
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 7 09:07:53 2020 -0800
x11: Set type hints based on surface type
Set the ewmh type hints based on the surface type and
transient parent, instead of taking it from the type hint.
gdk/x11/gdksurface-x11.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index f5ed52895c..dbfb262a87 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -794,6 +794,8 @@ disconnect_frame_clock (GdkSurface *surface)
static void gdk_x11_surface_set_title (GdkSurface *surface,
const char *title);
+static void gdk_x11_surface_set_type_hint (GdkSurface *surface,
+ GdkSurfaceTypeHint hint);
GdkSurface *
_gdk_x11_display_create_surface (GdkDisplay *display,
@@ -913,6 +915,10 @@ _gdk_x11_display_create_surface (GdkDisplay *display,
_gdk_x11_display_add_window (x11_screen->display, &impl->xid, surface);
gdk_x11_surface_set_title (surface, get_default_title ());
+ if (surface->surface_type == GDK_SURFACE_TOPLEVEL)
+ gdk_x11_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_NORMAL);
+ else if (surface->surface_type == GDK_SURFACE_POPUP)
+ gdk_x11_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_MENU);
class_hint = XAllocClassHint ();
class_hint->res_name = (char *) g_get_prgname ();
@@ -2351,13 +2357,19 @@ gdk_x11_surface_set_transient_for (GdkSurface *surface,
/* XSetTransientForHint() doesn't allow unsetting, so do it manually */
if (parent && !GDK_SURFACE_DESTROYED (parent))
- XSetTransientForHint (GDK_SURFACE_XDISPLAY (surface),
- GDK_SURFACE_XID (surface),
- GDK_SURFACE_XID (parent));
+ {
+ XSetTransientForHint (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ GDK_SURFACE_XID (parent));
+ gdk_x11_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_DIALOG);
+ }
else
- XDeleteProperty (GDK_SURFACE_XDISPLAY (surface),
- GDK_SURFACE_XID (surface),
- gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"WM_TRANSIENT_FOR"));
+ {
+ XDeleteProperty (GDK_SURFACE_XDISPLAY (surface),
+ GDK_SURFACE_XID (surface),
+ gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
"WM_TRANSIENT_FOR"));
+ gdk_x11_surface_set_type_hint (surface, GDK_SURFACE_TYPE_HINT_NORMAL);
+ }
}
GdkCursor *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]