OK, sorry. I hope, it's better now:).
On Mon, 4 Apr 2011, Tamas TEVESZ wrote:
On Fri, 1 Apr 2011, Ambrus Szabo wrote: the changelog should be something along the lines of "with xinerama, on heads other than the primary, certain parts of a client (menus, scrollbars) were not correctly or at all drawn." other than this nit, carlos, do push this, and do push this now. splendid stuff, splendid. -- [-] mkdir /nonexistent -- To unsubscribe, send mail to [email protected].
From 24e5ad662fe1c6f0646a89e0f5c0c9ec6af605b1 Mon Sep 17 00:00:00 2001 From: Ambrus Szabo <[email protected]> Date: Mon, 4 Apr 2011 16:46:22 +0200 Subject: [PATCH] xinerma bugfix: update window workspace property --- src/moveres.c | 14 +++++++++++++- src/screen.c | 3 ++- src/window.c | 6 ++++++ src/wmspec.c | 34 ++++++++++++++++++++++++++++++++++ src/wmspec.h | 1 + 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/moveres.c b/src/moveres.c index c84deab..a8bea3e 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -40,6 +40,7 @@ #include "geomview.h" #include "screen.h" +#include "wmspec.h" #include "xinerama.h" #include <WINGs/WINGsP.h> @@ -1533,7 +1534,9 @@ int wKeyboardMoveResizeWindow(WWindow * wwin) head != wGetHeadForWindow(wwin)) { wArrangeIcons(scr, True); } - +#ifdef XINERAMA + updateWMUpdateWorkarea(wwin); +#endif return 1; } } @@ -1795,6 +1798,9 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev) head != wGetHeadForWindow(wwin)) { wArrangeIcons(scr, True); } +#ifdef XINERAMA + updateWMUpdateWorkarea(wwin); +#endif return started; } @@ -2078,12 +2084,18 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev) wWindowConfigure(wwin, fx, fy, fw, fh - vert_border); } +#ifdef XINERAMA + updateWMUpdateWorkarea(wwin); +#endif return; default: WMHandleEvent(&event); } } +#ifdef XINERAMA + updateWMUpdateWorkarea(wwin); +#endif if (wPreferences.auto_arrange_icons && wXineramaHeads(scr) > 1 && head != wGetHeadForWindow(wwin)) { wArrangeIcons(scr, True); diff --git a/src/screen.c b/src/screen.c index 782ea1e..17464a8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -893,8 +893,9 @@ void wScreenUpdateUsableArea(WScreen * scr) } } } - +#ifndef XINERAMA wNETWMUpdateWorkarea(scr, area); +#endif if (wPreferences.auto_arrange_icons) wArrangeIcons(scr, True); diff --git a/src/window.c b/src/window.c index bfc0ade..8dd0134 100644 --- a/src/window.c +++ b/src/window.c @@ -1387,6 +1387,9 @@ WWindow *wManageWindow(WScreen *scr, Window window) wUnmanageWindow(wwin, True, False); wwin = NULL; } +#ifdef XINERAMA + updateWMUpdateWorkarea(wwin); +#endif return wwin; } @@ -1504,6 +1507,9 @@ WWindow *wManageInternalWindow(WScreen *scr, Window window, Window owner, wSetFocusTo(scr, wwin); wWindowResetMouseGrabs(wwin); wWindowSetKeyGrabs(wwin); +#ifdef XINERAMA + updateWMUpdateWorkarea(wwin); +#endif return wwin; } diff --git a/src/wmspec.c b/src/wmspec.c index d166d28..291bbbf 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -69,6 +69,7 @@ static Atom net_current_desktop; static Atom net_desktop_names; static Atom net_active_window; static Atom net_workarea; /* XXX: not xinerama compatible */ +static Atom xa_win_workspace; /* for xinerama compatible */ static Atom net_supporting_wm_check; static Atom net_virtual_roots; /* N/A */ static Atom net_desktop_layout; /* XXX */ @@ -145,6 +146,7 @@ static atomitem_t atomNames[] = { {"_NET_DESKTOP_NAMES", &net_desktop_names}, {"_NET_ACTIVE_WINDOW", &net_active_window}, {"_NET_WORKAREA", &net_workarea}, + {"XA_WIN_WORKSPACE", &xa_win_workspace}, {"_NET_SUPPORTING_WM_CHECK", &net_supporting_wm_check}, {"_NET_VIRTUAL_ROOTS", &net_virtual_roots}, {"_NET_DESKTOP_LAYOUT", &net_desktop_layout}, @@ -254,6 +256,7 @@ static void setSupportedHints(WScreen * scr) atom[i++] = net_desktop_names; atom[i++] = net_active_window; atom[i++] = net_workarea; + atom[i++] = xa_win_workspace; atom[i++] = net_supporting_wm_check; atom[i++] = net_showing_desktop; #if 0 @@ -655,6 +658,37 @@ void wNETWMUpdateWorkarea(WScreen * scr, WArea usableArea) wfree(area); } +void updateWMUpdateWorkarea(WWindow * wwin) { + WScreen *scr = wwin->screen_ptr; + if (scr->xine_info.count) { + long *area; + int count, i; + unsigned int w = wwin->client.width; + unsigned int h = wwin->client.height; + int x = wwin->client.x; + int y = wwin->client.y; + + + if (!scr->netdata || scr->workspace_count == 0) + return; + + count = scr->workspace_count * 4; + area = wmalloc(sizeof(long) * count); + for (i = 0; i < scr->workspace_count; i++) { + area[4 * i + 0] = x; + area[4 * i + 1] = y; + area[4 * i + 2] = w; + area[4 * i + 3] = h; + } + + XChangeProperty(dpy, scr->root_win, xa_win_workspace, XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)area, count); + + wfree(area); + } + +} + Bool wNETWMGetUsableArea(WScreen * scr, int head, WArea * area) { WReservedArea *cur; diff --git a/src/wmspec.h b/src/wmspec.h index 71f8ee0..fa4a797 100644 --- a/src/wmspec.h +++ b/src/wmspec.h @@ -31,6 +31,7 @@ void wNETWMInitStuff(WScreen *scr); void wNETWMCleanup(WScreen *scr); void wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea); +void updateWMUpdateWorkarea(WWindow * wwin); Bool wNETWMGetUsableArea(WScreen *scr, int head, WArea *area); Bool wNETWMCheckInitialClientState(WWindow *wwin); Bool wNETWMProcessClientMessage(XClientMessageEvent *event); -- 1.7.4.1
