aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
authorakir <akir>2004-09-09 14:29:10 (GMT)
committerakir <akir>2004-09-09 14:29:10 (GMT)
commit1d355a91925536ba2b4f0ffe652cb72540c91000 (patch)
treee323adb7f34038f1cdcd9c773339bb7ab679641f /src/FbTk/Menu.cc
parent7507098440e300c0126affbdd469456653b41e95 (diff)
downloadfluxbox_pavel-1d355a91925536ba2b4f0ffe652cb72540c91000.zip
fluxbox_pavel-1d355a91925536ba2b4f0ffe652cb72540c91000.tar.bz2
transfered ::getRootPixmap from several places to new home, FbPixmap
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index b38ae73..a1fdf8c 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.cc,v 1.79 2004/08/31 15:26:39 rathnor Exp $ 25// $Id: Menu.cc,v 1.80 2004/09/09 14:29:10 akir Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -44,6 +44,7 @@
44#include "Transparent.hh" 44#include "Transparent.hh"
45#include "SimpleCommand.hh" 45#include "SimpleCommand.hh"
46#include "I18n.hh" 46#include "I18n.hh"
47#include "FbPixmap.hh"
47 48
48#include <X11/Xatom.h> 49#include <X11/Xatom.h>
49#include <X11/keysym.h> 50#include <X11/keysym.h>
@@ -74,28 +75,6 @@ static Menu *shown = 0;
74 75
75Menu *Menu::s_focused = 0; 76Menu *Menu::s_focused = 0;
76 77
77static Pixmap getRootPixmap(int screen_num) {
78 Pixmap root_pm = 0;
79 // get root pixmap for transparency
80 Display *disp = FbTk::App::instance()->display();
81 Atom real_type;
82 int real_format;
83 unsigned long items_read, items_left;
84 unsigned int *data;
85 if (XGetWindowProperty(disp, RootWindow(disp, screen_num),
86 XInternAtom(disp, "_XROOTPMAP_ID", false),
87 0L, 1L,
88 false, XA_PIXMAP, &real_type,
89 &real_format, &items_read, &items_left,
90 (unsigned char **) &data) == Success &&
91 items_read) {
92 root_pm = (Pixmap) (*data);
93 XFree(data);
94 }
95
96 return root_pm;
97}
98
99Menu::Menu(MenuTheme &tm, ImageControl &imgctrl): 78Menu::Menu(MenuTheme &tm, ImageControl &imgctrl):
100 m_theme(tm), 79 m_theme(tm),
101 m_parent(0), 80 m_parent(0),
@@ -1406,7 +1385,7 @@ void Menu::reconfigure() {
1406 } else if (alpha () < 255) { 1385 } else if (alpha () < 255) {
1407 1386
1408 if (m_transp.get() == 0) { 1387 if (m_transp.get() == 0) {
1409 m_transp.reset(new Transparent(getRootPixmap(screenNumber()), 1388 m_transp.reset(new Transparent(FbPixmap::getRootPixmap(screenNumber()),
1410 m_real_frame_pm.drawable(), alpha(), 1389 m_real_frame_pm.drawable(), alpha(),
1411 screenNumber())); 1390 screenNumber()));
1412 } else 1391 } else
@@ -1497,7 +1476,7 @@ void Menu::renderTransp(int x, int y,
1497 // render the root background 1476 // render the root background
1498#ifdef HAVE_XRENDER 1477#ifdef HAVE_XRENDER
1499 1478
1500 Pixmap root = getRootPixmap(screenNumber()); 1479 Pixmap root = FbPixmap::getRootPixmap(screenNumber());
1501 if (m_transp->source() != root) 1480 if (m_transp->source() != root)
1502 m_transp->setSource(root, screenNumber()); 1481 m_transp->setSource(root, screenNumber());
1503 1482