Commit 654dfb67 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

struts: add support for _NET_WM_STRUT_AREA

parent b25f16c6
Pipeline #47567 failed with stage
in 4 minutes and 10 seconds
......@@ -313,7 +313,8 @@ panel_struts_set_window_hint (PanelToplevel *toplevel)
strut->orientation,
strut_size,
strut->allocated_strut_start,
strut->allocated_strut_end);
strut->allocated_strut_end,
&strut->allocated_geometry);
}
void
......@@ -322,7 +323,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_set_strut (gtk_widget_get_window (GTK_WIDGET (toplevel)), 0, 0, 0, 0, NULL);
}
static inline int
......
......@@ -32,6 +32,7 @@
static Atom net_wm_strut = None;
static Atom net_wm_strut_partial = None;
static Atom net_wm_strut_area = None;
enum {
STRUT_LEFT = 0,
......@@ -53,12 +54,14 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
PanelOrientation orientation,
guint32 strut,
guint32 strut_start,
guint32 strut_end)
guint32 strut_end,
GdkRectangle *rect)
{
GdkDisplay *display;
Display *xdisplay;
Window xwindow;
gulong struts [12] = { 0, };
gulong area[4] = { 0, };
g_return_if_fail (GDK_IS_WINDOW (gdk_window));
......@@ -70,6 +73,8 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
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);
if (net_wm_strut_area == None)
net_wm_strut_area = XInternAtom (xdisplay, "_NET_WM_STRUT_AREA", False);
switch (orientation) {
case PANEL_ORIENTATION_LEFT:
......@@ -97,6 +102,13 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
break;
}
if (rect != NULL) {
area[0] = rect->x;
area[1] = rect->y;
area[2] = rect->width;
area[3] = rect->height;
}
gdk_x11_display_error_trap_push (display);
XChangeProperty (xdisplay, xwindow, net_wm_strut,
XA_CARDINAL, 32, PropModeReplace,
......@@ -104,6 +116,9 @@ panel_xutils_set_strut (GdkWindow *gdk_window,
XChangeProperty (xdisplay, xwindow, net_wm_strut_partial,
XA_CARDINAL, 32, PropModeReplace,
(guchar *) &struts, 12);
XChangeProperty (xdisplay, xwindow, net_wm_strut_area,
XA_CARDINAL, 32, PropModeReplace,
(guchar *) &area, 4);
gdk_x11_display_error_trap_pop_ignored (display);
}
......
......@@ -34,7 +34,8 @@ void panel_xutils_set_strut (GdkWindow *gdk_window,
PanelOrientation orientation,
guint32 strut,
guint32 strut_start,
guint32 strut_end);
guint32 strut_end,
GdkRectangle *rect);
void panel_warp_pointer (GdkWindow *gdk_window,
int x,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment