aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-03-19 14:00:34 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-03-19 14:00:34 (GMT)
commit767afd32f3903be52a40ed1d41490b2dd4e5af1c (patch)
treeea754a0d47b58f6f42c935554fdac71f81e096b4 /src
parenta798e0e0ffe327b405206a561538e88d1e8db7da (diff)
downloadfluxbox_pavel-767afd32f3903be52a40ed1d41490b2dd4e5af1c.zip
fluxbox_pavel-767afd32f3903be52a40ed1d41490b2dd4e5af1c.tar.bz2
prepare BScreen::XineramaHeadInfo to be 'RectangleLike'
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc19
-rw-r--r--src/Screen.hh6
2 files changed, 15 insertions, 10 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 39bb966..d3df049 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -53,6 +53,7 @@
53#include "FbTk/CommandParser.hh" 53#include "FbTk/CommandParser.hh"
54#include "AtomHandler.hh" 54#include "AtomHandler.hh"
55#include "HeadArea.hh" 55#include "HeadArea.hh"
56#include "RectangleUtil.hh"
56#include "FbCommands.hh" 57#include "FbCommands.hh"
57#include "SystemTray.hh" 58#include "SystemTray.hh"
58#include "Debug.hh" 59#include "Debug.hh"
@@ -1950,10 +1951,10 @@ void BScreen::initXinerama() {
1950 m_xinerama_headinfo = new XineramaHeadInfo[number]; 1951 m_xinerama_headinfo = new XineramaHeadInfo[number];
1951 m_xinerama_num_heads = number; 1952 m_xinerama_num_heads = number;
1952 for (int i=0; i < number; i++) { 1953 for (int i=0; i < number; i++) {
1953 m_xinerama_headinfo[i].x = screen_info[i].x_org; 1954 m_xinerama_headinfo[i]._x = screen_info[i].x_org;
1954 m_xinerama_headinfo[i].y = screen_info[i].y_org; 1955 m_xinerama_headinfo[i]._y = screen_info[i].y_org;
1955 m_xinerama_headinfo[i].width = screen_info[i].width; 1956 m_xinerama_headinfo[i]._width = screen_info[i].width;
1956 m_xinerama_headinfo[i].height = screen_info[i].height; 1957 m_xinerama_headinfo[i]._height = screen_info[i].height;
1957 } 1958 }
1958 XFree(screen_info); 1959 XFree(screen_info);
1959 1960
@@ -2034,7 +2035,7 @@ int BScreen::getHead(const FbTk::FbWindow &win) const {
2034 for (i = 0; i < m_xinerama_num_heads; ++i) { 2035 for (i = 0; i < m_xinerama_num_heads; ++i) {
2035 2036
2036 XineramaHeadInfo& hi = m_xinerama_headinfo[i]; 2037 XineramaHeadInfo& hi = m_xinerama_headinfo[i];
2037 int d = calcSquareDistance(cx, cy, hi.x + (hi.width / 2), hi.y + (hi.height / 2)); 2038 int d = calcSquareDistance(cx, cy, hi.x() + (hi.width() / 2), hi.y() + (hi.height() / 2));
2038 2039
2039 if (dist == -1 || d < dist) { // found a closer head 2040 if (dist == -1 || d < dist) { // found a closer head
2040 head = i + 1; 2041 head = i + 1;
@@ -2068,7 +2069,7 @@ int BScreen::getCurrHead() const {
2068int BScreen::getHeadX(int head) const { 2069int BScreen::getHeadX(int head) const {
2069#ifdef XINERAMA 2070#ifdef XINERAMA
2070 if (head == 0 || head > m_xinerama_num_heads) return 0; 2071 if (head == 0 || head > m_xinerama_num_heads) return 0;
2071 return m_xinerama_headinfo[head-1].x; 2072 return m_xinerama_headinfo[head-1].x();
2072#else 2073#else
2073 return 0; 2074 return 0;
2074#endif // XINERAMA 2075#endif // XINERAMA
@@ -2077,7 +2078,7 @@ int BScreen::getHeadX(int head) const {
2077int BScreen::getHeadY(int head) const { 2078int BScreen::getHeadY(int head) const {
2078#ifdef XINERAMA 2079#ifdef XINERAMA
2079 if (head == 0 || head > m_xinerama_num_heads) return 0; 2080 if (head == 0 || head > m_xinerama_num_heads) return 0;
2080 return m_xinerama_headinfo[head-1].y; 2081 return m_xinerama_headinfo[head-1].y();
2081#else 2082#else
2082 return 0; 2083 return 0;
2083#endif // XINERAMA 2084#endif // XINERAMA
@@ -2086,7 +2087,7 @@ int BScreen::getHeadY(int head) const {
2086int BScreen::getHeadWidth(int head) const { 2087int BScreen::getHeadWidth(int head) const {
2087#ifdef XINERAMA 2088#ifdef XINERAMA
2088 if (head == 0 || head > m_xinerama_num_heads) return width(); 2089 if (head == 0 || head > m_xinerama_num_heads) return width();
2089 return m_xinerama_headinfo[head-1].width; 2090 return m_xinerama_headinfo[head-1].width();
2090#else 2091#else
2091 return width(); 2092 return width();
2092#endif // XINERAMA 2093#endif // XINERAMA
@@ -2095,7 +2096,7 @@ int BScreen::getHeadWidth(int head) const {
2095int BScreen::getHeadHeight(int head) const { 2096int BScreen::getHeadHeight(int head) const {
2096#ifdef XINERAMA 2097#ifdef XINERAMA
2097 if (head == 0 || head > m_xinerama_num_heads) return height(); 2098 if (head == 0 || head > m_xinerama_num_heads) return height();
2098 return m_xinerama_headinfo[head-1].height; 2099 return m_xinerama_headinfo[head-1].height();
2099#else 2100#else
2100 return height(); 2101 return height();
2101#endif // XINERAMA 2102#endif // XINERAMA
diff --git a/src/Screen.hh b/src/Screen.hh
index 0f023b9..97ac284 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -579,7 +579,11 @@ private:
579 std::vector<HeadArea *> m_head_areas; 579 std::vector<HeadArea *> m_head_areas;
580 580
581 struct XineramaHeadInfo { 581 struct XineramaHeadInfo {
582 int x, y, width, height; 582 int _x, _y, _width, _height;
583 int x() const { return _x; }
584 int y() const { return _y; }
585 int width() const { return _width; }
586 int height() const { return _height; }
583 } *m_xinerama_headinfo; 587 } *m_xinerama_headinfo;
584 588
585 bool m_restart, m_shutdown; 589 bool m_restart, m_shutdown;