From af628c2acd213ee450542c1cf8d3ded014717db4 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sat, 10 Apr 2021 19:56:28 +0200 Subject: struts: add panel_xutils_unset_strut origin commit: https://gitlab.gnome.org/GNOME/gnome-panel/-/commit/3e96a81 --- mate-panel/panel-struts.c | 2 +- mate-panel/panel-xutils.c | 24 ++++++++++++++++++++++++ mate-panel/panel-xutils.h | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mate-panel/panel-struts.c b/mate-panel/panel-struts.c index 2035c647..dc0958f5 100644 --- a/mate-panel/panel-struts.c +++ b/mate-panel/panel-struts.c @@ -333,7 +333,7 @@ panel_struts_unset_window_hint (PanelToplevel *toplevel) if (!gtk_widget_get_realized (GTK_WIDGET (toplevel))) return; - panel_xutils_set_strut (gtk_widget_get_window (GTK_WIDGET (toplevel)), 0, 0, 0, 0); + panel_xutils_unset_strut (gtk_widget_get_window (GTK_WIDGET (toplevel))); } static inline int diff --git a/mate-panel/panel-xutils.c b/mate-panel/panel-xutils.c index 1db10800..732f85ff 100644 --- a/mate-panel/panel-xutils.c +++ b/mate-panel/panel-xutils.c @@ -111,6 +111,30 @@ panel_xutils_set_strut (GdkWindow *gdk_window, gdk_x11_display_error_trap_pop_ignored (display); } +void +panel_xutils_unset_strut (GdkWindow *gdk_window) +{ + GdkDisplay *display; + Display *xdisplay; + Window xwindow; + + display = gdk_window_get_display (gdk_window); + xdisplay = gdk_x11_display_get_xdisplay (display); + xwindow = gdk_x11_window_get_xid (gdk_window); + + if (net_wm_strut == None) + net_wm_strut = XInternAtom (xdisplay, "_NET_WM_STRUT", False); + if (net_wm_strut_partial == None) + net_wm_strut_partial = XInternAtom (xdisplay, "_NET_WM_STRUT_PARTIAL", False); + + gdk_x11_display_error_trap_push (display); + + XDeleteProperty (xdisplay, xwindow, net_wm_strut); + XDeleteProperty (xdisplay, xwindow, net_wm_strut_partial); + + gdk_x11_display_error_trap_pop_ignored (display); +} + void panel_warp_pointer (GdkWindow *gdk_window, int x, diff --git a/mate-panel/panel-xutils.h b/mate-panel/panel-xutils.h index aebc77c4..603cb4ba 100644 --- a/mate-panel/panel-xutils.h +++ b/mate-panel/panel-xutils.h @@ -49,6 +49,8 @@ void panel_xutils_set_strut (GdkWindow *gdk_window, guint32 strut_start, guint32 strut_end); +void panel_xutils_unset_strut (GdkWindow *gdk_window); + void panel_warp_pointer (GdkWindow *gdk_window, int x, int y); -- cgit v1.2.1