From d2a50e03206f58557cfed0ab4bcd12a2c833eb0a Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Fri, 25 Apr 2003 11:56:13 +0000
Subject: minor fix for root pixmap

---
 src/Screen.cc | 40 ++++++++++++++++++++++++----------------
 src/Screen.hh |  6 ++----
 2 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/Screen.cc b/src/Screen.cc
index 57ae7f0..ac60d79 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Screen.cc,v 1.132 2003/04/25 11:05:11 fluxgen Exp $
+// $Id: Screen.cc,v 1.133 2003/04/25 11:56:13 fluxgen Exp $
 
 
 #include "Screen.hh"
@@ -544,21 +544,6 @@ BScreen::BScreen(ResourceManager &rm,
                     (unsigned char *) &bpid, 1);
 #endif // HAVE_GETPID
 
-    Atom real_type;
-    int real_format;
-    unsigned long items_read, items_left;
-    unsigned int *data;
-    if (XGetWindowProperty(disp, getRootWindow(),
-                           XInternAtom(disp, "_XROOTPMAP_ID", false),
-                           0L, 1L, 
-                           false, XA_PIXMAP, &real_type,
-                           &real_format, &items_read, &items_left, 
-                           (unsigned char **) &data) == Success && 
-        items_read) { 
-        m_root_pm = (Pixmap) (*data);                  
-        XFree(data);
-    } else 
-        m_root_pm = 0;
 
     cycling_window = focused_list.end();
 
@@ -784,6 +769,29 @@ FbTk::Menu &BScreen::getToolbarModemenu() {
 unsigned int BScreen::getCurrentWorkspaceID() const { 
     return current_workspace->workspaceID(); 
 }
+
+Pixmap BScreen::rootPixmap() const {
+
+    Pixmap root_pm = 0;
+    Display *disp = FbTk::App::instance()->display();
+    Atom real_type;
+    int real_format;
+    unsigned long items_read, items_left;
+    unsigned int *data;
+    if (XGetWindowProperty(disp, getRootWindow(),
+                           XInternAtom(disp, "_XROOTPMAP_ID", false),
+                           0L, 1L, 
+                           false, XA_PIXMAP, &real_type,
+                           &real_format, &items_read, &items_left, 
+                           (unsigned char **) &data) == Success && 
+        items_read) { 
+        root_pm = (Pixmap) (*data);                  
+        XFree(data);
+    }
+
+    return root_pm;
+
+}
     
 /// TODO
 unsigned int BScreen::getMaxLeft() const {
diff --git a/src/Screen.hh b/src/Screen.hh
index 1ba480d..42be8da 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Screen.hh,v 1.85 2003/04/25 11:40:22 fluxgen Exp $
+// $Id: Screen.hh,v 1.86 2003/04/25 11:56:12 fluxgen Exp $
 
 #ifndef	 SCREEN_HH
 #define	 SCREEN_HH
@@ -129,7 +129,7 @@ public:
     FbTk::Menu *getWorkspacemenu() { return workspacemenu.get(); }
 
     unsigned int getCurrentWorkspaceID() const;
-    Pixmap rootPixmap() const { return m_root_pm; }
+    Pixmap rootPixmap() const;
     /*
       maximum screen surface
     */
@@ -412,8 +412,6 @@ private:
 
     std::auto_ptr<RootTheme> m_root_theme;
     ToolbarHandler *m_toolbarhandler;
-    Pixmap m_root_pm;
-  
 };
 
 
-- 
cgit v0.11.2