[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/windowmanagement
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2009-11-25 23:04:33
Message-ID: 1259190273.420992.16405.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1054374 by fredrik:

Add _KDE_NET_WM_FRAME_OVERLAP.

 M  +56 -1     netwm.cpp  
 M  +21 -0     netwm.h  
 M  +2 -1      netwm_def.h  
 M  +1 -0      netwm_p.h  


--- trunk/KDE/kdelibs/kdeui/windowmanagement/netwm.cpp #1054373:1054374
@@ -95,6 +95,7 @@
 static Atom kde_net_wm_window_type_override   = 0;
 static Atom kde_net_wm_window_type_topmenu    = 0;
 static Atom kde_net_wm_temporary_rules        = 0;
+static Atom kde_net_wm_frame_overlap          = 0;
 
 // application protocols
 static Atom wm_protocols = 0;
@@ -249,7 +250,7 @@
 }
 
 
-static const int netAtomCount = 85;
+static const int netAtomCount = 86;
 static void create_netwm_atoms(Display *d) {
     static const char * const names[netAtomCount] =
     {
@@ -341,6 +342,7 @@
 	    "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE",
 	    "_KDE_NET_WM_WINDOW_TYPE_TOPMENU",
             "_KDE_NET_WM_TEMPORARY_RULES",
+            "_KDE_NET_WM_FRAME_OVERLAP",
 
 	    "WM_STATE",
 	    "WM_PROTOCOLS",
@@ -438,6 +440,7 @@
 	    &kde_net_wm_window_type_override,
 	    &kde_net_wm_window_type_topmenu,
             &kde_net_wm_temporary_rules,
+            &kde_net_wm_frame_overlap,
 
 	    &xa_wm_state,
 	    &wm_protocols,
@@ -1270,6 +1273,10 @@
 	atoms[pnum++] = kde_net_wm_frame_strut;
     }
 
+    if (p->properties[ PROTOCOLS2 ] & WM2FrameOverlap) {
+	atoms[pnum++] = kde_net_wm_frame_overlap;
+    }
+
     if (p->properties[ PROTOCOLS2 ] & WM2KDETemporaryRules)
 	atoms[pnum++] = kde_net_wm_temporary_rules;
     if (p->properties[ PROTOCOLS2 ] & WM2FullPlacement)
@@ -1502,6 +1509,8 @@
         p->properties[ PROTOCOLS ] |= WMFrameExtents;
     else if( atom == kde_net_wm_frame_strut )
         p->properties[ PROTOCOLS ] |= WMFrameExtents;
+    else if( atom == kde_net_wm_frame_overlap )
+        p->properties[ PROTOCOLS2 ] |= WM2FrameOverlap;
 
     else if( atom == kde_net_wm_temporary_rules )
         p->properties[ PROTOCOLS2 ] |= WM2KDETemporaryRules;
@@ -3469,6 +3478,30 @@
     return p->frame_strut;
 }
 
+void NETWinInfo::setFrameOverlap(NETStrut strut) {
+    if (strut.left != -1 || strut.top != -1 || strut.right != -1 || strut.bottom != -1) {
+        strut.left   = qMax(0, strut.left);
+        strut.top    = qMax(0, strut.top);
+        strut.right  = qMax(0, strut.right);
+        strut.bottom = qMax(0, strut.bottom);
+    }
+
+    p->frame_overlap = strut;
+
+    long d[4];
+    d[0] = strut.left;
+    d[1] = strut.right;
+    d[2] = strut.top;
+    d[3] = strut.bottom;
+
+    XChangeProperty(p->display, p->window, kde_net_wm_frame_overlap, XA_CARDINAL, 32,
+		    PropModeReplace, (unsigned char *) d, 4);
+}
+
+NETStrut NETWinInfo::frameOverlap() const {
+    return p->frame_overlap;
+}
+
 void NETWinInfo::kdeGeometry(NETRect& frame, NETRect& window) {
     if (p->win_geom.size.width == 0 || p->win_geom.size.height == 0) {
 	Window unused;
@@ -3731,6 +3764,8 @@
 		dirty |= WMFrameExtents;
 	    else if (pe.xproperty.atom == kde_net_wm_frame_strut)
 		dirty |= WMFrameExtents;
+	    else if (pe.xproperty.atom == kde_net_wm_frame_overlap)
+		dirty2 |= WM2FrameOverlap;
 	    else if (pe.xproperty.atom == net_wm_icon_name)
 		dirty |= WMIconName;
 	    else if (pe.xproperty.atom == net_wm_visible_icon_name)
@@ -4188,6 +4223,26 @@
 	}
     }
 
+    if (dirty2 & WM2FrameOverlap) {
+        p->frame_overlap = NETStrut();
+        bool ok = false;
+        if (XGetWindowProperty(p->display, p->window, kde_net_wm_frame_overlap,
+                               0l, 4l, False, XA_CARDINAL, &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret) == Success) {
+            if (type_ret == XA_CARDINAL && format_ret == 32 && nitems_ret == 4) {
+                ok = true;
+                long *d = (long *) data_ret;
+
+                p->frame_overlap.left   = d[0];
+                p->frame_overlap.right  = d[1];
+                p->frame_overlap.top    = d[2];
+                p->frame_overlap.bottom = d[3];
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
     if (dirty & WMPid) {
 	p->pid = 0;
 	if (XGetWindowProperty(p->display, p->window, net_wm_pid, 0l, 1l,
--- trunk/KDE/kdelibs/kdeui/windowmanagement/netwm.h #1054373:1054374
@@ -1118,6 +1118,27 @@
     NETStrut frameExtents() const;
 
     /**
+       Sets the window frame overlap strut, i.e. how far the window frame extends
+       behind the client area on each side.
+
+       Set the strut values to -1 if you want the window frame to cover the whole
+       client area.
+
+       The default values are 0.
+
+       @since 4.4
+    **/
+    void setFrameOverlap(NETStrut strut);
+
+    /**
+       Returns the frame overlap strut, i.e. how far the window frame extends
+       behind the client area on each side.
+
+       @since 4.4
+    **/ 
+    NETStrut frameOverlap() const;
+
+    /**
        Returns an icon.  If width and height are passed, the icon returned will be
        the closest it can find (the next biggest).  If width and height are omitted,
        then the largest icon in the list is returned.
--- trunk/KDE/kdelibs/kdeui/windowmanagement/netwm_def.h #1054373:1054374
@@ -690,7 +690,8 @@
         WM2Opacity             = 1<<14,
         WM2DesktopLayout       = 1<<15,        
         WM2FullPlacement       = 1<<16,
-        WM2FullscreenMonitors  = 1<<17
+        WM2FullscreenMonitors  = 1<<17,
+        WM2FrameOverlap        = 1<<18  // NOT STANDARD
     };
 
     /**
--- trunk/KDE/kdelibs/kdeui/windowmanagement/netwm_p.h #1054373:1054374
@@ -137,6 +137,7 @@
     NETExtendedStrut extended_strut;
     NETStrut strut;
     NETStrut frame_strut; // strut?
+    NETStrut frame_overlap;
     NETRArray<NET::WindowType> types;
     char *name, *visible_name, *icon_name, *visible_icon_name;
     int desktop;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic