aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.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/Screen.cc
parent7507098440e300c0126affbdd469456653b41e95 (diff)
downloadfluxbox-1d355a91925536ba2b4f0ffe652cb72540c91000.zip
fluxbox-1d355a91925536ba2b4f0ffe652cb72540c91000.tar.bz2
transfered ::getRootPixmap from several places to new home, FbPixmap
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc44
1 files changed, 11 insertions, 33 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 67e954b..8372f0f 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.288 2004/09/06 13:17:56 akir Exp $ 25// $Id: Screen.cc,v 1.289 2004/09/09 14:29:03 akir Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -231,7 +231,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
231 m_shutdown(false) { 231 m_shutdown(false) {
232 232
233 233
234 Display *disp = FbTk::App::instance()->display(); 234 Fluxbox *fluxbox = Fluxbox::instance();
235 Display *disp = fluxbox->display();
235 236
236 initXinerama(); 237 initXinerama();
237 238
@@ -242,7 +243,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
242 SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | 243 SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
243 ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask); 244 ButtonPressMask | ButtonReleaseMask| SubstructureNotifyMask);
244 245
245 FbTk::App::instance()->sync(false); 246 fluxbox->sync(false);
246 247
247 XSetErrorHandler((XErrorHandler) old); 248 XSetErrorHandler((XErrorHandler) old);
248 249
@@ -263,7 +264,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
263 264
264 rootWindow().setCursor(XCreateFontCursor(disp, XC_left_ptr)); 265 rootWindow().setCursor(XCreateFontCursor(disp, XC_left_ptr));
265 266
266 Fluxbox *fluxbox = Fluxbox::instance();
267 // load this screens resources 267 // load this screens resources
268 fluxbox->load_rc(*this); 268 fluxbox->load_rc(*this);
269 269
@@ -378,7 +378,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
378 // So we lock root theme temporary so it doesn't uses RootTheme::reconfigTheme 378 // So we lock root theme temporary so it doesn't uses RootTheme::reconfigTheme
379 // This must be fixed in the future. 379 // This must be fixed in the future.
380 m_root_theme->lock(true); 380 m_root_theme->lock(true);
381 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename()); 381 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename());
382 m_root_theme->lock(false); 382 m_root_theme->lock(false);
383 m_root_theme->setLineAttributes(*resource.gc_line_width, 383 m_root_theme->setLineAttributes(*resource.gc_line_width,
384 *resource.gc_line_style, 384 *resource.gc_line_style,
@@ -386,8 +386,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
386 *resource.gc_join_style); 386 *resource.gc_join_style);
387 387
388#ifdef SLIT 388#ifdef SLIT
389 m_slit.reset(new Slit(*this, *layerManager().getLayer(Fluxbox::instance()->getDesktopLayer()), 389 m_slit.reset(new Slit(*this, *layerManager().getLayer(fluxbox->getDesktopLayer()),
390 Fluxbox::instance()->getSlitlistFilename().c_str())); 390 fluxbox->getSlitlistFilename().c_str()));
391#endif // SLIT 391#endif // SLIT
392 392
393 rm.unlock(); 393 rm.unlock();
@@ -445,7 +445,7 @@ void BScreen::initWindows() {
445 Fluxbox *fluxbox = Fluxbox::instance(); 445 Fluxbox *fluxbox = Fluxbox::instance();
446 446
447 // preen the window list of all icon windows... for better dockapp support 447 // preen the window list of all icon windows... for better dockapp support
448 for (int i = 0; i < (int) nchild; i++) { 448 for (unsigned int i = 0; i < nchild; i++) {
449 449
450 if (children[i] == None) 450 if (children[i] == None)
451 continue; 451 continue;
@@ -455,7 +455,7 @@ void BScreen::initWindows() {
455 if (wmhints) { 455 if (wmhints) {
456 if ((wmhints->flags & IconWindowHint) && 456 if ((wmhints->flags & IconWindowHint) &&
457 (wmhints->icon_window != children[i])) 457 (wmhints->icon_window != children[i]))
458 for (int j = 0; j < (int) nchild; j++) { 458 for (unsigned int j = 0; j < nchild; j++) {
459 if (children[j] == wmhints->icon_window) { 459 if (children[j] == wmhints->icon_window) {
460#ifdef DEBUG 460#ifdef DEBUG
461 cerr<<"BScreen::initWindows(): children[j] = 0x"<<hex<<children[j]<<dec<<endl; 461 cerr<<"BScreen::initWindows(): children[j] = 0x"<<hex<<children[j]<<dec<<endl;
@@ -474,7 +474,7 @@ void BScreen::initWindows() {
474 // complexity: O(n^2) if we have lots of transients to transient_for 474 // complexity: O(n^2) if we have lots of transients to transient_for
475 // but usually O(n) 475 // but usually O(n)
476 Window transient_for = 0; 476 Window transient_for = 0;
477 for (int i = 0; i < (int) nchild; ++i) { 477 for (unsigned int i = 0; i < nchild; ++i) {
478 if (children[i] == None) 478 if (children[i] == None)
479 continue; 479 continue;
480 else if (!fluxbox->validateWindow(children[i])) { 480 else if (!fluxbox->validateWindow(children[i])) {
@@ -493,7 +493,7 @@ void BScreen::initWindows() {
493 fluxbox->searchWindow(transient_for) == 0) { 493 fluxbox->searchWindow(transient_for) == 0) {
494 // search forward for transient_for 494 // search forward for transient_for
495 // and swap place with it so it gets created first 495 // and swap place with it so it gets created first
496 int j = i + 1; 496 unsigned int j = i + 1;
497 for (; j < nchild; ++j) { 497 for (; j < nchild; ++j) {
498 if (children[j] == transient_for) { 498 if (children[j] == transient_for) {
499 swap(children[i], children[j]); 499 swap(children[i], children[j]);
@@ -548,28 +548,6 @@ unsigned int BScreen::currentWorkspaceID() const {
548 return m_current_workspace->workspaceID(); 548 return m_current_workspace->workspaceID();
549} 549}
550 550
551Pixmap BScreen::rootPixmap() const {
552
553 Pixmap root_pm = 0;
554 Display *disp = FbTk::App::instance()->display();
555 Atom real_type;
556 int real_format;
557 unsigned long items_read, items_left;
558 unsigned int *data;
559 if (rootWindow().property(XInternAtom(disp, "_XROOTPMAP_ID", false),
560 0L, 1L,
561 false, XA_PIXMAP, &real_type,
562 &real_format, &items_read, &items_left,
563 (unsigned char **) &data) &&
564 items_read) {
565 root_pm = (Pixmap) (*data);
566 XFree(data);
567 }
568
569 return root_pm;
570
571}
572
573unsigned int BScreen::maxLeft(int head) const { 551unsigned int BScreen::maxLeft(int head) const {
574 // we ignore strut if we're doing full maximization 552 // we ignore strut if we're doing full maximization
575 if (hasXinerama()) 553 if (hasXinerama())