diff options
author | raveit65 <[email protected]> | 2021-04-10 14:21:30 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-06-07 20:09:03 +0200 |
commit | 4e4fd6c512423b16640914b33192a32f290b0ef1 (patch) | |
tree | fc0543f1a06f75523e281bdd535677c2f4103543 /src/core/screen.c | |
parent | 4ec1bb6d8f3f7079d52a71c40028b9ee93a00311 (diff) | |
download | marco-4e4fd6c512423b16640914b33192a32f290b0ef1.tar.bz2 marco-4e4fd6c512423b16640914b33192a32f290b0ef1.tar.xz |
screen: add support for _GTK_WORKAREAS_Dn
In addition to existing _NET_WORKAREA property set also new
_GTK_WORKAREAS_Dn property where n is desktop number (between 0
and _NET_NUMBER_OF_DESKTOPS - 1).
https://mail.gnome.org/archives/wm-spec-list/2018-December/msg00000.html
https://gitlab.freedesktop.org/xdg/xdg-specs/merge_requests/22
origin commit:
https://gitlab.gnome.org/GNOME/metacity/-/commit/3d8b03d
Diffstat (limited to 'src/core/screen.c')
-rw-r--r-- | src/core/screen.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/core/screen.c b/src/core/screen.c index 5e65fd2a..c5962cb2 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -108,6 +108,7 @@ set_supported_hint (MetaScreen *screen) #undef EWMH_ATOMS_ONLY screen->display->atom__GTK_FRAME_EXTENTS, screen->display->atom__GTK_SHOW_WINDOW_MENU, + screen->display->atom__GTK_WORKAREAS }; XChangeProperty (screen->display->xdisplay, screen->xroot, @@ -2035,6 +2036,48 @@ meta_create_offscreen_window (Display *xdisplay, } static void +set_workspace_work_area_hint (MetaWorkspace *workspace, + MetaScreen *screen) +{ + unsigned long *data; + unsigned long *tmp; + int i; + gchar *workarea_name; + Atom workarea_atom; + + data = g_new (unsigned long, screen->n_xinerama_infos * 4); + tmp = data; + + for (i = 0; i < screen->n_xinerama_infos; i++) + { + MetaRectangle area; + + meta_workspace_get_work_area_for_xinerama (workspace, i, &area); + + tmp[0] = area.x; + tmp[1] = area.y; + tmp[2] = area.width; + tmp[3] = area.height; + + tmp += 4; + } + + workarea_name = g_strdup_printf ("_GTK_WORKAREAS_D%d", + meta_workspace_index (workspace)); + + workarea_atom = XInternAtom (screen->display->xdisplay, workarea_name, False); + g_free (workarea_name); + + meta_error_trap_push (screen->display); + XChangeProperty (screen->display->xdisplay, screen->xroot, workarea_atom, + XA_CARDINAL, 32, PropModeReplace, + (guchar*) data, screen->n_xinerama_infos * 4); + meta_error_trap_pop (screen->display, TRUE); + + g_free (data); +} + +static void set_work_area_hint (MetaScreen *screen) { int num_workspaces; @@ -2054,6 +2097,7 @@ set_work_area_hint (MetaScreen *screen) if (workspace->screen == screen) { meta_workspace_get_work_area_all_xineramas (workspace, &area); + set_workspace_work_area_hint (workspace, screen); tmp[0] = area.x; tmp[1] = area.y; tmp[2] = area.width; |