diff options
author | rathnor <rathnor> | 2003-05-20 11:03:11 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-05-20 11:03:11 (GMT) |
commit | a88511a4a772ec021029649905b7ce645ff9a597 (patch) | |
tree | d75369cc8a4e7b2be9bf9ef1ecc3d5ac771dbc6f /src/Screen.cc | |
parent | f911c4035fe86ed4c85a79f96aaab30902d56f89 (diff) | |
download | fluxbox_pavel-a88511a4a772ec021029649905b7ce645ff9a597.zip fluxbox_pavel-a88511a4a772ec021029649905b7ce645ff9a597.tar.bz2 |
xinerama for placement + snapping, + tidy
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 0d1614d..f67b63a 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.174 2003/05/19 22:45:17 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.175 2003/05/20 11:03:10 rathnor Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -808,47 +808,31 @@ Pixmap BScreen::rootPixmap() const { | |||
808 | 808 | ||
809 | } | 809 | } |
810 | 810 | ||
811 | unsigned int BScreen::maxLeft(const FbTk::FbWindow &win) const { | 811 | unsigned int BScreen::maxLeft(int head) const { |
812 | if (hasXinerama()) { | 812 | if (hasXinerama()) |
813 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | ||
814 | // we MUST use a head, we use the center of the window, or if that | ||
815 | // isn't in a head, then the mouse's head | ||
816 | if (head == 0) head = getCurrHead(); | ||
817 | return getHeadX(head); | 813 | return getHeadX(head); |
818 | } else | 814 | else |
819 | return 0; | 815 | return 0; |
820 | } | 816 | } |
821 | 817 | ||
822 | unsigned int BScreen::maxRight(const FbTk::FbWindow &win) const { | 818 | unsigned int BScreen::maxRight(int head) const { |
823 | if (hasXinerama()) { | 819 | if (hasXinerama()) |
824 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | ||
825 | // we MUST use a head, we use the center of the window, or if that | ||
826 | // isn't in a head, then the mouse's head | ||
827 | if (head == 0) head = getCurrHead(); | ||
828 | return getHeadX(head) + getHeadWidth(head); | 820 | return getHeadX(head) + getHeadWidth(head); |
829 | } else | 821 | else |
830 | return width(); | 822 | return width(); |
831 | } | 823 | } |
832 | 824 | ||
833 | unsigned int BScreen::maxTop(const FbTk::FbWindow &win) const { | 825 | unsigned int BScreen::maxTop(int head) const { |
834 | if (hasXinerama()) { | 826 | if (hasXinerama()) |
835 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | ||
836 | // we MUST use a head, we use the center of the window, or if that | ||
837 | // isn't in a head, then the mouse's head | ||
838 | if (head == 0) head = getCurrHead(); | ||
839 | return getHeadY(head); | 827 | return getHeadY(head); |
840 | } else | 828 | else |
841 | return 0; | 829 | return 0; |
842 | } | 830 | } |
843 | 831 | ||
844 | unsigned int BScreen::maxBottom(const FbTk::FbWindow &win) const { | 832 | unsigned int BScreen::maxBottom(int head) const { |
845 | if (hasXinerama()) { | 833 | if (hasXinerama()) |
846 | int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2); | ||
847 | // we MUST use a head, we use the center of the window, or if that | ||
848 | // isn't in a head, then the mouse's head | ||
849 | if (head == 0) head = getCurrHead(); | ||
850 | return getHeadY(head) + getHeadHeight(head); | 834 | return getHeadY(head) + getHeadHeight(head); |
851 | } else | 835 | else |
852 | return height(); | 836 | return height(); |
853 | } | 837 | } |
854 | 838 | ||
@@ -2605,6 +2589,14 @@ int BScreen::getHead(int x, int y) const { | |||
2605 | return 0; | 2589 | return 0; |
2606 | } | 2590 | } |
2607 | 2591 | ||
2592 | int BScreen::getHead(FbTk::FbWindow &win) const { | ||
2593 | if (hasXinerama()) | ||
2594 | return getHead(win.x() + win.width()/2, win.y() + win.height()/2); | ||
2595 | else | ||
2596 | return 0; | ||
2597 | } | ||
2598 | |||
2599 | |||
2608 | int BScreen::getCurrHead() const { | 2600 | int BScreen::getCurrHead() const { |
2609 | if (!hasXinerama()) return 0; | 2601 | if (!hasXinerama()) return 0; |
2610 | int root_x = 0, root_y = 0; | 2602 | int root_x = 0, root_y = 0; |