aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2015-01-16 07:44:49 (GMT)
committerMathias Gumz <akira@fluxbox.org>2015-01-16 07:45:11 (GMT)
commitb30438c311a356f7bb1621f1ed3cb9a99e7d96c9 (patch)
treeb99b2d5cf07ec7cb700e4ece58d86a93f8236cd5 /src/Screen.hh
parent6d5781ce7198a8a82fd0cae8554e4c120d01df3d (diff)
downloadfluxbox-b30438c311a356f7bb1621f1ed3cb9a99e7d96c9.zip
fluxbox-b30438c311a356f7bb1621f1ed3cb9a99e7d96c9.tar.bz2
Refactor: bundle xinerama-info together, simpler code
Part of this massive looking but simple rather simple change is a the way we check for active Xinerama: XineramaIsActive() was used before. The docs for XineramaQueryScreens() state that XineramaQueryScreens() returns NULL and sets number to 0 if Xinerama is not active. Sold.
Diffstat (limited to 'src/Screen.hh')
-rw-r--r--src/Screen.hh29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/Screen.hh b/src/Screen.hh
index eb2a306..771899f 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -370,14 +370,14 @@ public:
370 // Xinerama-related functions 370 // Xinerama-related functions
371 371
372 /// @return true if xinerama is available 372 /// @return true if xinerama is available
373 bool hasXinerama() const { return m_xinerama_avail; } 373 bool hasXinerama() const { return m_xinerama.avail; }
374 /// @return umber of xinerama heads 374 /// @return umber of xinerama heads
375 int numHeads() const { return m_xinerama_num_heads; } 375 int numHeads() const { return m_xinerama.heads.size(); }
376 376
377 void initXinerama(); 377 void initXinerama();
378 void clearXinerama();
378 void clearHeads(); 379 void clearHeads();
379 /// clean up xinerama 380 /// clean up xinerama
380 void clearXinerama();
381 381
382 /** 382 /**
383 * Determines head number for a position 383 * Determines head number for a position
@@ -475,7 +475,7 @@ private:
475 475
476 FbTk::MultLayers m_layermanager; 476 FbTk::MultLayers m_layermanager;
477 477
478 bool root_colormap_installed, managed; 478 bool root_colormap_installed;
479 479
480 std::auto_ptr<FbTk::ImageControl> m_image_control; 480 std::auto_ptr<FbTk::ImageControl> m_image_control;
481 std::auto_ptr<FbMenu> m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu; 481 std::auto_ptr<FbMenu> m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu;
@@ -525,21 +525,26 @@ private:
525 const ClientPattern *m_cycle_opts; 525 const ClientPattern *m_cycle_opts;
526 526
527 // Xinerama related private data 527 // Xinerama related private data
528 bool m_xinerama_avail;
529 int m_xinerama_num_heads;
530 int m_xinerama_center_x, m_xinerama_center_y;
531
532 std::vector<HeadArea *> m_head_areas;
533
534 struct XineramaHeadInfo { 528 struct XineramaHeadInfo {
535 int _x, _y, _width, _height; 529 int _x, _y, _width, _height;
536 int x() const { return _x; } 530 int x() const { return _x; }
537 int y() const { return _y; } 531 int y() const { return _y; }
538 int width() const { return _width; } 532 int width() const { return _width; }
539 int height() const { return _height; } 533 int height() const { return _height; }
540 } *m_xinerama_headinfo; 534 };
535 struct {
536 bool avail;
537 int center_x;
538 int center_y;
539 std::vector<XineramaHeadInfo> heads;
540 } m_xinerama;
541
542 std::vector<HeadArea*> m_head_areas;
543
541 544
542 bool m_restart, m_shutdown; 545 bool m_restart;
546 bool m_shutdown;
547 bool managed;
543}; 548};
544 549
545 550