Hello,

Xinerama compatible, (try) fixed.

In second display, can use menu(Smplayer) and navi/scroll/bar (Opera)....

Perhaps, fix are not consistency of old conception.
From 72857d58d6b4a95029c383894c0623f7c0415565 Mon Sep 17 00:00:00 2001
From: Ambrus Szabo <[email protected]>
Date: Fri, 1 Apr 2011 20:48:41 +0200
Subject: [PATCH] xinerama: update active display number,parameter

---
 src/moveres.c |   14 +++++++++++++-
 src/window.c  |    6 ++++++
 src/wmspec.c  |   30 +++++++++++++++++++++++++++++-
 src/wmspec.h  |    1 +
 4 files changed, 49 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/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..5628084 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
@@ -649,12 +652,37 @@ void wNETWMUpdateWorkarea(WScreen * scr, WArea usableArea)
                area[4 * i + 3] = usableArea.y2 - usableArea.y1;
        }
 
-       XChangeProperty(dpy, scr->root_win, net_workarea, XA_CARDINAL, 32,
+       XChangeProperty(dpy, scr->root_win, xa_win_workspace, XA_CARDINAL, 32,
                        PropModeReplace, (unsigned char *)area, count);
 
        wfree(area);
 }
 
+void updateWMUpdateWorkarea(WWindow * wwin) {
+       WScreen *scr = wwin->screen_ptr;
+       if (scr->xine_info.count) {
+               unsigned int w = wwin->client.width;
+               unsigned int h = wwin->client.height;
+               int x = wwin->client.x;
+               int y = wwin->client.y;
+               WMRect rect;//TODO:ezt
+               int head, flags;
+               WArea area;
+
+               rect.pos.x = x;
+               rect.pos.y = y;
+               rect.size.width = w;
+               rect.size.height = h;
+
+               head = wGetRectPlacementInfo(scr, rect, &flags);
+
+               area = scr->totalUsableArea[head];
+               wNETWMUpdateWorkarea(scr, 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

Reply via email to