aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc90
-rw-r--r--src/Screen.hh27
-rw-r--r--src/Slit.cc10
-rw-r--r--src/Toolbar.cc9
-rw-r--r--src/Window.cc20
-rw-r--r--src/Workspace.cc11
6 files changed, 100 insertions, 67 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index aaa2209..5c61289 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.172 2003/05/19 14:26:29 rathnor Exp $ 25// $Id: Screen.cc,v 1.173 2003/05/19 15:32:46 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -53,6 +53,7 @@
53#include "WinClient.hh" 53#include "WinClient.hh"
54#include "Subject.hh" 54#include "Subject.hh"
55#include "FbWinFrame.hh" 55#include "FbWinFrame.hh"
56#include "FbWindow.hh"
56 57
57//use GNU extensions 58//use GNU extensions
58#ifndef _GNU_SOURCE 59#ifndef _GNU_SOURCE
@@ -523,9 +524,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
523 524
524 Display *disp = FbTk::App::instance()->display(); 525 Display *disp = FbTk::App::instance()->display();
525 526
526#ifdef XINERAMA 527 initXinerama();
527 initXinerama(disp);
528#endif // XINERAMA
529 528
530 event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask | 529 event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
531 SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | 530 SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
@@ -815,23 +814,47 @@ Pixmap BScreen::rootPixmap() const {
815 814
816} 815}
817 816
818/// TODO 817unsigned int BScreen::maxLeft(FbTk::FbWindow &win) const {
819unsigned int BScreen::maxLeft() const { 818 if (hasXinerama()) {
820 return 0; 819 int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2);
820 // we MUST use a head, we use the center of the window, or if that
821 // isn't in a head, then the mouse's head
822 if (head == 0) head = getCurrHead();
823 return getHeadX(head);
824 } else
825 return 0;
821} 826}
822 827
823///!! TODO 828unsigned int BScreen::maxRight(FbTk::FbWindow &win) const {
824unsigned int BScreen::maxRight() const { 829 if (hasXinerama()) {
825 return width(); 830 int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2);
831 // we MUST use a head, we use the center of the window, or if that
832 // isn't in a head, then the mouse's head
833 if (head == 0) head = getCurrHead();
834 return getHeadX(head) + getHeadWidth(head);
835 } else
836 return width();
826} 837}
827 838
828///!! TODO 839unsigned int BScreen::maxTop(FbTk::FbWindow &win) const {
829unsigned int BScreen::maxTop() const { 840 if (hasXinerama()) {
830 return 0; 841 int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2);
842 // we MUST use a head, we use the center of the window, or if that
843 // isn't in a head, then the mouse's head
844 if (head == 0) head = getCurrHead();
845 return getHeadY(head);
846 } else
847 return 0;
831} 848}
832///!! TODO 849unsigned int BScreen::maxBottom(FbTk::FbWindow &win) const {
833unsigned int BScreen::maxBottom() const { 850 if (hasXinerama()) {
834 return height(); 851 int head = getHead(win.x() + win.width()/2, win.y() + win.height()/2);
852 // we MUST use a head, we use the center of the window, or if that
853 // isn't in a head, then the mouse's head
854 if (head == 0) head = getCurrHead();
855 return getHeadY(head) + getHeadHeight(head);
856 } else
857 return height();
835} 858}
836 859
837void BScreen::reconfigure() { 860void BScreen::reconfigure() {
@@ -2542,9 +2565,11 @@ void BScreen::updateSize() {
2542 2565
2543} 2566}
2544 2567
2568
2569void BScreen::initXinerama() {
2545#ifdef XINERAMA 2570#ifdef XINERAMA
2571 Display *display = FbTk::App::instance()->display();
2546 2572
2547void BScreen::initXinerama(Display *display) {
2548 if (!XineramaIsActive(display)) { 2573 if (!XineramaIsActive(display)) {
2549 m_xinerama_avail = false; 2574 m_xinerama_avail = false;
2550 m_xinerama_headinfo = 0; 2575 m_xinerama_headinfo = 0;
@@ -2563,11 +2588,16 @@ void BScreen::initXinerama(Display *display) {
2563 m_xinerama_headinfo[i].width = screen_info[i].width; 2588 m_xinerama_headinfo[i].width = screen_info[i].width;
2564 m_xinerama_headinfo[i].height = screen_info[i].height; 2589 m_xinerama_headinfo[i].height = screen_info[i].height;
2565 } 2590 }
2591#else // XINERAMA
2592 m_xinerama_avail = false;
2593 m_xinerama_num_heads = 0;
2594#endif // XINERAMA
2566 2595
2567} 2596}
2568 2597
2569int BScreen::getHead(int x, int y) const { 2598int BScreen::getHead(int x, int y) const {
2570 if (!hasXinerama()) return 0; 2599 if (!hasXinerama()) return 0;
2600#ifdef XINERAMA
2571 2601
2572 for (int i=0; i < m_xinerama_num_heads; i++) { 2602 for (int i=0; i < m_xinerama_num_heads; i++) {
2573 if (x >= m_xinerama_headinfo[i].x && 2603 if (x >= m_xinerama_headinfo[i].x &&
@@ -2578,13 +2608,15 @@ int BScreen::getHead(int x, int y) const {
2578 } 2608 }
2579 } 2609 }
2580 2610
2611#endif // XINERAMA
2581 return 0; 2612 return 0;
2582} 2613}
2583 2614
2584int BScreen::getCurrHead() const { 2615int BScreen::getCurrHead() const {
2585 if (!hasXinerama()) return 0; 2616 if (!hasXinerama()) return 0;
2586 int root_x, root_y, ignore_i; 2617 int root_x = 0, root_y = 0;
2587 2618#ifdef XINERAMA
2619 int ignore_i;
2588 unsigned int ignore_ui; 2620 unsigned int ignore_ui;
2589 2621
2590 Window ignore_w; 2622 Window ignore_w;
@@ -2593,28 +2625,44 @@ int BScreen::getCurrHead() const {
2593 rootWindow().window(), &ignore_w, 2625 rootWindow().window(), &ignore_w,
2594 &ignore_w, &root_x, &root_y, 2626 &ignore_w, &root_x, &root_y,
2595 &ignore_i, &ignore_i, &ignore_ui); 2627 &ignore_i, &ignore_i, &ignore_ui);
2628#endif // XINERAMA
2596 return getHead(root_x, root_y); 2629 return getHead(root_x, root_y);
2597
2598} 2630}
2599 2631
2600int BScreen::getHeadX(int head) const { 2632int BScreen::getHeadX(int head) const {
2633#ifdef XINERAMA
2601 if (head == 0 || head > m_xinerama_num_heads) return 0; 2634 if (head == 0 || head > m_xinerama_num_heads) return 0;
2602 return m_xinerama_headinfo[head-1].x; 2635 return m_xinerama_headinfo[head-1].x;
2636#else
2637 return 0;
2638#endif // XINERAMA
2603} 2639}
2604 2640
2605int BScreen::getHeadY(int head) const { 2641int BScreen::getHeadY(int head) const {
2642#ifdef XINERAMA
2606 if (head == 0 || head > m_xinerama_num_heads) return 0; 2643 if (head == 0 || head > m_xinerama_num_heads) return 0;
2607 return m_xinerama_headinfo[head-1].y; 2644 return m_xinerama_headinfo[head-1].y;
2645#else
2646 return 0;
2647#endif // XINERAMA
2608} 2648}
2609 2649
2610int BScreen::getHeadWidth(int head) const { 2650int BScreen::getHeadWidth(int head) const {
2651#ifdef XINERAMA
2611 if (head == 0 || head > m_xinerama_num_heads) return width(); 2652 if (head == 0 || head > m_xinerama_num_heads) return width();
2612 return m_xinerama_headinfo[head-1].width; 2653 return m_xinerama_headinfo[head-1].width;
2654#else
2655 return width();
2656#endif // XINERAMA
2613} 2657}
2614 2658
2615int BScreen::getHeadHeight(int head) const { 2659int BScreen::getHeadHeight(int head) const {
2660#ifdef XINERAMA
2616 if (head == 0 || head > m_xinerama_num_heads) return height(); 2661 if (head == 0 || head > m_xinerama_num_heads) return height();
2617 return m_xinerama_headinfo[head-1].height; 2662 return m_xinerama_headinfo[head-1].height;
2663#else
2664 return height();
2665#endif // XINERAMA
2618} 2666}
2619 2667
2620template <> 2668template <>
@@ -2638,5 +2686,3 @@ void BScreen::setOnHead<Slit>(Slit &slit, int head) {
2638 saveSlitOnHead(head); 2686 saveSlitOnHead(head);
2639 slit.reconfigure(); 2687 slit.reconfigure();
2640} 2688}
2641
2642#endif // XINERAMA
diff --git a/src/Screen.hh b/src/Screen.hh
index f5585c7..59a26c1 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -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.hh,v 1.100 2003/05/19 14:26:30 rathnor Exp $ 25// $Id: Screen.hh,v 1.101 2003/05/19 15:32:46 rathnor Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -58,6 +58,7 @@ class MenuTheme;
58class Menu; 58class Menu;
59class ImageControl; 59class ImageControl;
60class XLayerItem; 60class XLayerItem;
61class FbWindow;
61}; 62};
62 63
63/// Handles screen connection, screen clients and workspaces 64/// Handles screen connection, screen clients and workspaces
@@ -134,12 +135,12 @@ public:
134 unsigned int currentWorkspaceID() const; 135 unsigned int currentWorkspaceID() const;
135 Pixmap rootPixmap() const; 136 Pixmap rootPixmap() const;
136 /* 137 /*
137 maximum screen surface 138 maximum screen bounds for given window
138 */ 139 */
139 unsigned int maxLeft() const; 140 unsigned int maxLeft(FbTk::FbWindow &win) const;
140 unsigned int maxRight() const; 141 unsigned int maxRight(FbTk::FbWindow &win) const;
141 unsigned int maxTop() const; 142 unsigned int maxTop(FbTk::FbWindow &win) const;
142 unsigned int maxBottom() const; 143 unsigned int maxBottom(FbTk::FbWindow &win) const;
143 144
144 inline unsigned int width() const { return rootWindow().width(); } 145 inline unsigned int width() const { return rootWindow().width(); }
145 inline unsigned int height() const { return rootWindow().height(); } 146 inline unsigned int height() const { return rootWindow().height(); }
@@ -296,12 +297,11 @@ public:
296 /// (and maximized windows?) 297 /// (and maximized windows?)
297 void updateSize(); 298 void updateSize();
298 299
299#ifdef XINERAMA
300 // Xinerama-related functions 300 // Xinerama-related functions
301 inline bool hasXinerama() const { return m_xinerama_avail; } 301 inline bool hasXinerama() const { return m_xinerama_avail; }
302 inline int numHeads() const { return m_xinerama_num_heads; } 302 inline int numHeads() const { return m_xinerama_num_heads; }
303 303
304 void initXinerama(Display *display); 304 void initXinerama();
305 305
306 int getHead(int x, int y) const; 306 int getHead(int x, int y) const;
307 int getCurrHead() const; 307 int getCurrHead() const;
@@ -310,14 +310,13 @@ public:
310 int getHeadWidth(int head) const; 310 int getHeadWidth(int head) const;
311 int getHeadHeight(int head) const; 311 int getHeadHeight(int head) const;
312 312
313 // magic to allow us to have "on head" placement without 313 // magic to allow us to have "on head" placement (menu) without
314 // the object really knowing about it. 314 // the object really knowing about it.
315 template <typename OnHeadObject> 315 template <typename OnHeadObject>
316 int getOnHead(OnHeadObject &obj); 316 int getOnHead(OnHeadObject &obj);
317 317
318 template <typename OnHeadObject> 318 template <typename OnHeadObject>
319 void setOnHead(OnHeadObject &obj, int head); 319 void setOnHead(OnHeadObject &obj, int head);
320#endif // XINERAMA
321 320
322 // notify netizens 321 // notify netizens
323 void updateNetizenCurrentWorkspace(); 322 void updateNetizenCurrentWorkspace();
@@ -447,19 +446,17 @@ private:
447 446
448 std::auto_ptr<ToolbarHandler> m_toolbarhandler; 447 std::auto_ptr<ToolbarHandler> m_toolbarhandler;
449 448
450#ifdef XINERAMA
451 // Xinerama related private data
452 bool m_xinerama_avail; 449 bool m_xinerama_avail;
453 int m_xinerama_num_heads; 450 int m_xinerama_num_heads;
451
452#ifdef XINERAMA
453 // Xinerama related private data
454 454
455 int m_xinerama_center_x, m_xinerama_center_y; 455 int m_xinerama_center_x, m_xinerama_center_y;
456 456
457 struct XineramaHeadInfo { 457 struct XineramaHeadInfo {
458 int x, y, width, height; 458 int x, y, width, height;
459 } *m_xinerama_headinfo; 459 } *m_xinerama_headinfo;
460
461
462
463#endif 460#endif
464}; 461};
465 462
diff --git a/src/Slit.cc b/src/Slit.cc
index b2dd383..8830cb8 100644
--- a/src/Slit.cc
+++ b/src/Slit.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: Slit.cc,v 1.56 2003/05/19 14:26:30 rathnor Exp $ 25// $Id: Slit.cc,v 1.57 2003/05/19 15:32:47 rathnor Exp $
26 26
27#include "Slit.hh" 27#include "Slit.hh"
28 28
@@ -51,10 +51,7 @@
51#include "FbMenu.hh" 51#include "FbMenu.hh"
52#include "Transparent.hh" 52#include "Transparent.hh"
53#include "IntResMenuItem.hh" 53#include "IntResMenuItem.hh"
54
55#ifdef XINERAMA
56#include "Xinerama.hh" 54#include "Xinerama.hh"
57#endif // XINERAMA
58 55
59#include <algorithm> 56#include <algorithm>
60#include <iostream> 57#include <iostream>
@@ -794,16 +791,13 @@ void Slit::reposition() {
794 head_w, 791 head_w,
795 head_h; 792 head_h;
796 793
797#ifdef XINERAMA
798 if (screen().hasXinerama()) { 794 if (screen().hasXinerama()) {
799 int head = screen().getSlitOnHead(); 795 int head = screen().getSlitOnHead();
800 head_x = screen().getHeadX(head); 796 head_x = screen().getHeadX(head);
801 head_y = screen().getHeadY(head); 797 head_y = screen().getHeadY(head);
802 head_w = screen().getHeadWidth(head); 798 head_w = screen().getHeadWidth(head);
803 head_h = screen().getHeadHeight(head); 799 head_h = screen().getHeadHeight(head);
804 } else 800 } else {
805#endif // XINERAMA
806 {
807 head_w = screen().width(); 801 head_w = screen().width();
808 head_h = screen().height(); 802 head_h = screen().height();
809 } 803 }
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 9a29f79..a000c99 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.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: Toolbar.cc,v 1.85 2003/05/19 14:26:30 rathnor Exp $ 25// $Id: Toolbar.cc,v 1.86 2003/05/19 15:32:47 rathnor Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -42,10 +42,7 @@
42#include "RootTheme.hh" 42#include "RootTheme.hh"
43#include "BoolMenuItem.hh" 43#include "BoolMenuItem.hh"
44#include "FbWinFrameTheme.hh" 44#include "FbWinFrameTheme.hh"
45
46#ifdef XINERAMA
47#include "Xinerama.hh" 45#include "Xinerama.hh"
48#endif XINERAMA
49 46
50// use GNU extensions 47// use GNU extensions
51#ifndef _GNU_SOURCE 48#ifndef _GNU_SOURCE
@@ -138,7 +135,7 @@ void setupMenus(Toolbar &tbar) {
138 menu.setInternalMenu(); 135 menu.setInternalMenu();
139 136
140 menu.insert("Layer...", &tbar.layermenu()); 137 menu.insert("Layer...", &tbar.layermenu());
141#ifdef XINERAMA 138
142 if (tbar.screen().hasXinerama()) { 139 if (tbar.screen().hasXinerama()) {
143 menu.insert("On Head...", new XineramaHeadMenu<Toolbar>( 140 menu.insert("On Head...", new XineramaHeadMenu<Toolbar>(
144 *tbar.screen().menuTheme(), 141 *tbar.screen().menuTheme(),
@@ -148,8 +145,6 @@ void setupMenus(Toolbar &tbar) {
148 &tbar 145 &tbar
149 )); 146 ));
150 } 147 }
151
152#endif //XINERAMA
153 148
154 // setup items in placement menu 149 // setup items in placement menu
155 struct { 150 struct {
diff --git a/src/Window.cc b/src/Window.cc
index 21018c2..46c8e63 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.179 2003/05/17 11:08:06 fluxgen Exp $ 25// $Id: Window.cc,v 1.180 2003/05/19 15:32:47 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -1386,12 +1386,12 @@ void FluxboxWindow::maximize() {
1386 m_old_height = frame().height(); 1386 m_old_height = frame().height();
1387 m_old_pos_x = frame().x(); 1387 m_old_pos_x = frame().x();
1388 m_old_pos_y = frame().y(); 1388 m_old_pos_y = frame().y();
1389 unsigned int left_x = screen().maxLeft(); 1389 unsigned int left_x = screen().maxLeft(frame().window());
1390 unsigned int max_width = screen().maxRight(); 1390 unsigned int max_width = screen().maxRight(frame().window());
1391 unsigned int max_top = screen().maxTop(); 1391 unsigned int max_top = screen().maxTop(frame().window());
1392 moveResize(left_x, max_top, 1392 moveResize(left_x, max_top,
1393 max_width - left_x, 1393 max_width - left_x - 2*frame().window().borderWidth(),
1394 screen().maxBottom() - max_top - frame().window().borderWidth()); 1394 screen().maxBottom(frame().window()) - max_top - 2*frame().window().borderWidth());
1395 } else { // demaximize, restore to old values 1395 } else { // demaximize, restore to old values
1396 moveResize(m_old_pos_x, m_old_pos_y, 1396 moveResize(m_old_pos_x, m_old_pos_y,
1397 m_old_width, m_old_height); 1397 m_old_width, m_old_height);
@@ -1401,8 +1401,8 @@ void FluxboxWindow::maximize() {
1401} 1401}
1402 1402
1403void FluxboxWindow::maximizeHorizontal() { 1403void FluxboxWindow::maximizeHorizontal() {
1404 unsigned int left_x = screen().maxLeft(); 1404 unsigned int left_x = screen().maxLeft(frame().window());
1405 unsigned int max_width = screen().maxRight(); 1405 unsigned int max_width = screen().maxRight(frame().window());
1406 moveResize(left_x, frame().y(), 1406 moveResize(left_x, frame().y(),
1407 max_width - left_x, frame().height() - frame().window().borderWidth()); 1407 max_width - left_x, frame().height() - frame().window().borderWidth());
1408 1408
@@ -1412,10 +1412,10 @@ void FluxboxWindow::maximizeHorizontal() {
1412 Maximize window horizontal 1412 Maximize window horizontal
1413 */ 1413 */
1414void FluxboxWindow::maximizeVertical() { 1414void FluxboxWindow::maximizeVertical() {
1415 unsigned int max_top = screen().maxTop(); 1415 unsigned int max_top = screen().maxTop(frame().window());
1416 moveResize(frame().x(), max_top, 1416 moveResize(frame().x(), max_top,
1417 frame().width() - frame().window().borderWidth(), 1417 frame().width() - frame().window().borderWidth(),
1418 screen().maxBottom() - max_top); 1418 screen().maxBottom(frame().window()) - max_top);
1419} 1419}
1420 1420
1421 1421
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 3a662e6..db0cac2 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.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: Workspace.cc,v 1.66 2003/05/15 23:30:07 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.67 2003/05/19 15:32:47 rathnor Exp $
26 26
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
@@ -33,6 +33,7 @@
33#include "StringUtil.hh" 33#include "StringUtil.hh"
34#include "SimpleCommand.hh" 34#include "SimpleCommand.hh"
35#include "WinClient.hh" 35#include "WinClient.hh"
36#include "FbWinFrame.hh"
36 37
37// use GNU extensions 38// use GNU extensions
38#ifndef _GNU_SOURCE 39#ifndef _GNU_SOURCE
@@ -507,10 +508,10 @@ void Workspace::placeWindow(FluxboxWindow &win) {
507 test_x = root_x - (win_w / 2); 508 test_x = root_x - (win_w / 2);
508 test_y = root_y - (win_h / 2); 509 test_y = root_y - (win_h / 2);
509 510
510 min_x = (int) screen().maxLeft(); 511 min_x = (int) screen().maxLeft(win.frame().window());
511 min_y = (int) screen().maxTop(); 512 min_y = (int) screen().maxTop(win.frame().window());
512 max_x = (int) screen().maxRight() - win_w; 513 max_x = (int) screen().maxRight(win.frame().window()) - win_w;
513 max_y = (int) screen().maxBottom() - win_h; 514 max_y = (int) screen().maxBottom(win.frame().window()) - win_h;
514 515
515 // keep the window inside the screen 516 // keep the window inside the screen
516 517