diff options
author | raveit65 <[email protected]> | 2021-04-10 19:56:28 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-04-23 16:10:29 +0200 |
commit | af628c2acd213ee450542c1cf8d3ded014717db4 (patch) | |
tree | 663b18ab9e406b5481f394ff9e80cc60c53769d9 | |
parent | abaeb4e9be26d9c448434a6bfdd2f87a381f8d50 (diff) | |
download | mate-panel-af628c2acd213ee450542c1cf8d3ded014717db4.tar.bz2 mate-panel-af628c2acd213ee450542c1cf8d3ded014717db4.tar.xz |
struts: add panel_xutils_unset_strut
origin commit:
https://gitlab.gnome.org/GNOME/gnome-panel/-/commit/3e96a81
-rw-r--r-- | mate-panel/panel-struts.c | 2 | ||||
-rw-r--r-- | mate-panel/panel-xutils.c | 24 | ||||
-rw-r--r-- | mate-panel/panel-xutils.h | 2 |
3 files changed, 27 insertions, 1 deletions
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 @@ -112,6 +112,30 @@ panel_xutils_set_strut (GdkWindow *gdk_window, } 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, int y) 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); |