[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-12-16 17:48:10
Message-ID: 1260985690.973022.19085.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1063009 by fredrik:

Add NETRootInfo::setSupported(), to make it possible for window managers
to toggle properties in _NET_SUPPORTED after the NETRootInfo object has
been created.


 M  +65 -0     netwm.cpp  
 M  +33 -0     netwm.h  


--- trunk/KDE/kdelibs/kdeui/windowmanagement/netwm.cpp #1063008:1063009
@@ -2541,6 +2541,71 @@
         : p->client_properties;
 }
 
+void NETRootInfo::setSupported( NET::Property property, bool on ) {
+    if ( p->role != WindowManager )
+        return;
+
+    if ( on && !isSupported( property ) ) {
+        p->properties[ PROTOCOLS ] |= property;
+        setSupported();
+    } else if ( !on && isSupported( property ) ) {
+        p->properties[ PROTOCOLS ] &= ~property;
+        setSupported();
+    }
+}
+
+void NETRootInfo::setSupported( NET::Property2 property, bool on ) {
+    if ( p->role != WindowManager )
+        return;
+
+    if ( on && !isSupported( property ) ) {
+        p->properties[ PROTOCOLS2 ] |= property;
+        setSupported();
+    } else if ( !on && isSupported( property ) ) {
+        p->properties[ PROTOCOLS2 ] &= ~property;
+        setSupported();
+    }
+}
+
+void NETRootInfo::setSupported( NET::WindowType property, bool on ) {
+    if ( p->role != WindowManager )
+        return;
+
+    if ( on && !isSupported( property ) ) {
+        p->properties[ WINDOW_TYPES ] |= property;
+        setSupported();
+    } else if ( !on && isSupported( property ) ) {
+        p->properties[ WINDOW_TYPES ] &= ~property;
+        setSupported();
+    }
+}
+
+void NETRootInfo::setSupported( NET::State property, bool on ) {
+    if ( p->role != WindowManager )
+        return;
+
+    if ( on && !isSupported( property ) ) {
+        p->properties[ STATES ] |= property;
+        setSupported();
+    } else if ( !on && isSupported( property ) ) {
+        p->properties[ STATES ] &= ~property;
+        setSupported();
+    }
+}
+
+void NETRootInfo::setSupported( NET::Action property, bool on ) {
+    if ( p->role != WindowManager )
+        return;
+
+    if ( on && !isSupported( property ) ) {
+        p->properties[ ACTIONS ] |= property;
+        setSupported();
+    } else if ( !on && isSupported( property ) ) {
+        p->properties[ ACTIONS ] &= ~property;
+        setSupported();
+    }
+}
+
 bool NETRootInfo::isSupported( NET::Property property ) const {
     return p->properties[ PROTOCOLS ] & property;
 }
--- trunk/KDE/kdelibs/kdeui/windowmanagement/netwm.h #1063008:1063009
@@ -181,6 +181,39 @@
     int screenNumber() const;
 
     /**
+      Sets the given property if on is true, and clears the property otherwise.
+      In WindowManager mode this function updates _NET_SUPPORTED.
+      In Client mode this function does nothing.
+
+      @since 4.4
+     **/
+    void setSupported( NET::Property property, bool on = true );
+
+    /**
+      @overload
+      @since 4.4
+     **/
+    void setSupported( NET::Property2 property, bool on = true );
+
+    /**
+      @overload
+      @since 4.4
+     **/
+    void setSupported( NET::WindowType property, bool on = true );
+
+    /**
+      @overload
+      @since 4.4
+     **/
+    void setSupported( NET::State property, bool on = true );
+
+    /**
+      @overload
+      @since 4.4
+     **/
+    void setSupported( NET::Action property, bool on = true );
+
+    /**
        Returns true if the given property is supported by the window
        manager. Note that for Client mode, NET::Supported needs
        to be passed in the properties argument for this to work.
[prev in list] [next in list] [prev in thread] [next in thread] 

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