--- icewm-1.3.7/src/wmclient.h.orig 2010-11-01 01:09:36.000000000 +1100 +++ icewm-1.3.7/src/wmclient.h 2014-09-04 13:05:11.005868474 +1000 @@ -146,6 +146,7 @@ bool getNetWMDesktopHint(long *workspace); bool getNetWMStrut(int *left, int *right, int *top, int *bottom); bool getNetWMWindowType(Atom *window_type); + void setNetWMFullscreenMonitors(int top, int bottom, int left, int right); #endif #ifndef NO_MWM_HINTS --- icewm-1.3.7/src/wmframe.cc.orig 2010-11-01 01:09:36.000000000 +1100 +++ icewm-1.3.7/src/wmframe.cc 2014-09-04 13:05:11.088865459 +1000 @@ -116,6 +116,11 @@ fStrutTop = 0; fStrutBottom = 0; + fFullscreenMonitorsTop = -1; + fFullscreenMonitorsBottom = -1; + fFullscreenMonitorsLeft = -1; + fFullscreenMonitorsRight = -1; + setStyle(wsOverrideRedirect); setPointer(YXApplication::leftPointer); @@ -3106,16 +3111,29 @@ setWindowGeometry(YRect(iconX, iconY, fMiniIcon->width(), fMiniIcon->height())); } else { - int xiscreen = manager->getScreenForRect(posX, - posY, - posW, - posH); - - int dx, dy, dw, dh; - manager->getScreenGeometry(&dx, &dy, &dw, &dh, xiscreen); - if (isFullscreen()) { - setWindowGeometry(YRect(dx, dy, dw, dh)); + // for _NET_WM_FULLSCREEN_MONITORS + if (fFullscreenMonitorsTop >= 0 && fFullscreenMonitorsBottom >= 0 && + fFullscreenMonitorsLeft >= 0 && fFullscreenMonitorsRight >= 0) { + int x, y, w, h; + int monitor[4] = { fFullscreenMonitorsTop, fFullscreenMonitorsBottom, + fFullscreenMonitorsLeft, fFullscreenMonitorsRight }; + manager->getScreenGeometry(&x, &y, &w, &h, monitor[0]); + YRect* r = new YRect(x, y, w, h); + for (int i = 1; i < 4; i++) { + manager->getScreenGeometry(&x, &y, &w, &h, monitor[i]); + r->unionRect(x, y, w, h); + } + setWindowGeometry(*r); + } else { + int xiscreen = manager->getScreenForRect(posX, + posY, + posW, + posH); + int dx, dy, dw, dh; + manager->getScreenGeometry(&dx, &dy, &dw, &dh, xiscreen); + setWindowGeometry(YRect(dx, dy, dw, dh)); + } } else { if (isRollup()) { @@ -3431,6 +3449,22 @@ manager->updateWorkArea(); } } + +void YFrameWindow::updateNetWMFullscreenMonitors(int t, int b, int l, int r) { + if (t != fFullscreenMonitorsTop || + b != fFullscreenMonitorsBottom || + l != fFullscreenMonitorsLeft || + r != fFullscreenMonitorsRight) + { + fFullscreenMonitorsTop = t; + fFullscreenMonitorsBottom = b; + fFullscreenMonitorsLeft = l; + fFullscreenMonitorsRight = r; + MSG(("fullscreen monitors: %d %d %d %d", t, b, l, r)); + client()->setNetWMFullscreenMonitors(t, b, l, r); + updateLayout(); + } +} #endif /* Work around for X11R5 and earlier */ --- icewm-1.3.7/src/wmmgr.h.orig 2014-09-04 13:04:51.950968311 +1000 +++ icewm-1.3.7/src/wmmgr.h 2014-09-04 13:05:11.181864959 +1000 @@ -344,6 +344,7 @@ extern Atom _XA_NET_WM_PID; // TODO extern Atom _XA_NET_WM_HANDLED_ICONS; // TODO -> toggle minimizeToDesktop extern Atom _XA_NET_WM_PING; // TODO +extern Atom _XA_NET_WM_FULLSCREEN_MONITORS; // OK extern Atom _XA_NET_WM_USER_TIME; // TODO extern Atom _XA_NET_WM_STATE_DEMANDS_ATTENTION; // TODO --- icewm-1.3.7/src/yxapp.cc.orig 2014-09-04 13:04:53.597959464 +1000 +++ icewm-1.3.7/src/yxapp.cc 2014-09-04 13:07:49.933008081 +1000 @@ -69,6 +69,7 @@ Atom _XA_NET_CURRENT_DESKTOP; //Atom _XA_NET_WORKAREA; Atom _XA_NET_WM_MOVERESIZE; +Atom _XA_NET_WM_FULLSCREEN_MONITORS; Atom _XA_NET_WM_STRUT; Atom _XA_NET_WM_DESKTOP; @@ -285,6 +286,7 @@ { &_XA_NET_CLIENT_LIST, "_NET_CLIENT_LIST" }, { &_XA_NET_CLIENT_LIST_STACKING, "_NET_CLIENT_LIST_STACKING" }, { &_XA_NET_NUMBER_OF_DESKTOPS, "_NET_NUMBER_OF_DESKTOPS" }, + { &_XA_NET_WM_FULLSCREEN_MONITORS, "_NET_WM_FULLSCREEN_MONITORS" }, { &_XA_NET_CURRENT_DESKTOP, "_NET_CURRENT_DESKTOP" }, // { &_XA_NET_WORKAREA, "_NET_WORKAREA" }, { &_XA_NET_WM_MOVERESIZE, "_NET_WM_MOVERESIZE" }, --- icewm-1.3.7/src/wmclient.cc.orig 2014-09-04 13:04:53.352960780 +1000 +++ icewm-1.3.7/src/wmclient.cc 2014-09-04 13:05:11.335864131 +1000 @@ -488,6 +488,9 @@ if (getFrame()) getFrame()->updateNetWMStrut(); prop.net_wm_strut = new_prop; + } else if (property.atom == _XA_NET_WM_FULLSCREEN_MONITORS) { + // ignore - we triggered this event + // (do i need to set a property here?) #endif #ifdef WMSPEC_HINTS } else if (property.atom == _XA_NET_WM_ICON) { @@ -680,6 +683,19 @@ mask |= WinStateSkipTaskBar; return mask; } + +void YFrameClient::setNetWMFullscreenMonitors(int top, int bottom, int left, int right) { + // why do i have to do this? + unsigned long data[4] = { 0, 0, 0, 0 }; + data[0] = (unsigned long) top;; + data[1] = (unsigned long) bottom; + data[2] = (unsigned long) left; + data[3] = (unsigned long) right; + XChangeProperty (xapp->display(), handle(), + _XA_NET_WM_FULLSCREEN_MONITORS, XA_CARDINAL, + 32, PropModeReplace, + (unsigned char *) data, 4); +} #endif void YFrameClient::handleClientMessage(const XClientMessageEvent &message) { @@ -701,6 +717,12 @@ if (getFrame()) getFrame()->startMoveSize(message.data.l[0], message.data.l[1], message.data.l[2]); + } else if (message.message_type == _XA_NET_WM_FULLSCREEN_MONITORS) + { + if (getFrame()) { + getFrame()->updateNetWMFullscreenMonitors(message.data.l[0], message.data.l[1], + message.data.l[2], message.data.l[3]); + } } if (message.message_type == _XA_NET_WM_STATE) { long mask = --- icewm-1.3.7/src/wmframe.h.orig 2010-11-01 01:09:36.000000000 +1100 +++ icewm-1.3.7/src/wmframe.h 2014-09-04 13:05:11.408863738 +1000 @@ -413,6 +413,7 @@ #ifdef WMSPEC_HINTS void updateNetWMStrut(); + void updateNetWMFullscreenMonitors(int, int, int, int); #endif int strutLeft() { return fStrutLeft; } int strutRight() { return fStrutRight; } @@ -525,6 +526,11 @@ bool fManaged; long fWinOptionMask; long fOldLayer; + + int fFullscreenMonitorsTop; + int fFullscreenMonitorsBottom; + int fFullscreenMonitorsLeft; + int fFullscreenMonitorsRight; YMsgBox *fKillMsgBox; --- icewm-1.3.7/src/wmapp.cc.orig 2014-09-04 13:04:53.495960012 +1000 +++ icewm-1.3.7/src/wmapp.cc 2014-09-04 13:05:11.495863271 +1000 @@ -187,6 +187,7 @@ _XA_NET_ACTIVE_WINDOW, _XA_NET_CLOSE_WINDOW, _XA_NET_WM_STRUT, + _XA_NET_WM_FULLSCREEN_MONITORS, _XA_NET_WM_STATE, _XA_NET_WM_STATE_MAXIMIZED_VERT, _XA_NET_WM_STATE_MAXIMIZED_HORZ, --- icewm-1.3.7/src/yrect.h.orig 2010-11-01 01:09:36.000000000 +1100 +++ icewm-1.3.7/src/yrect.h 2014-09-04 13:05:11.565862894 +1000 @@ -2,6 +2,7 @@ #define __YRECT_H #include "ypoint.h" +#include // change this to use x,y,w,h internal representation? class YRect { @@ -49,6 +50,19 @@ ww = r.width(); hh = r.height(); } + + // does the same as gdk_rectangle_union + void unionRect(int x, int y, int width, int height) { + int dest_x, dest_y; + + dest_x = fmin(xx, x); + dest_y = fmin(yy, y); + ww = fmax(xx + ww, x + width) - dest_x; + hh = fmax(yy + hh, y + height) - dest_y; + xx = dest_x; + yy = dest_y; + } + //YPoint center() { return YPoint((x1 + x2) / 2, // (y1 + y2) / 2); }