summaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc54
1 files changed, 22 insertions, 32 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 16334c6..5d50fcf 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -41,6 +41,7 @@
41#include "FocusControl.hh" 41#include "FocusControl.hh"
42#include "IconButton.hh" 42#include "IconButton.hh"
43#include "ScreenPlacement.hh" 43#include "ScreenPlacement.hh"
44#include "RectangleUtil.hh"
44 45
45#include "FbTk/StringUtil.hh" 46#include "FbTk/StringUtil.hh"
46#include "FbTk/Compose.hh" 47#include "FbTk/Compose.hh"
@@ -2362,10 +2363,9 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
2362 m_last_button_x = be.x_root; 2363 m_last_button_x = be.x_root;
2363 m_last_button_y = be.y_root; 2364 m_last_button_y = be.y_root;
2364 2365
2365 bool onTitlebar = frame().gripLeft().window() != be.window && 2366 bool onTitlebar =
2366 frame().gripRight().window() != be.window && 2367 frame().insideTitlebar( be.window ) &&
2367 frame().handle().window() != be.window && 2368 frame().handle().window() != be.window;
2368 frame().window() != be.window;
2369 2369
2370 if (onTitlebar && be.button == 1) 2370 if (onTitlebar && be.button == 1)
2371 raise(); 2371 raise();
@@ -2422,41 +2422,31 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2422 me.window = frame().window().window(); 2422 me.window = frame().window().window();
2423 } 2423 }
2424 2424
2425 bool inside_titlebar = frame().gripLeft().window() != me.window && 2425 bool inside_titlebar = frame().insideTitlebar( me.window );
2426 frame().gripRight().window() != me.window &&
2427 frame().window() != me.window;
2428 2426
2429 if (Fluxbox::instance()->getIgnoreBorder() && m_attaching_tab == 0 2427 if (Fluxbox::instance()->getIgnoreBorder() && m_attaching_tab == 0
2430 && !(isMoving() || isResizing())) { 2428 && !(isMoving() || isResizing())) {
2429
2430 using RectangleUtil::insideBorder;
2431
2431 int borderw = frame().window().borderWidth(); 2432 int borderw = frame().window().borderWidth();
2432 //!! TODO(tabs): the below test ought to be in FbWinFrame 2433 //!! TODO(tabs): the below test ought to be in FbWinFrame
2433 // if mouse is currently on the window border, ignore it 2434 // if mouse is currently on the window border, ignore it
2434 if ((me.x_root < (frame().x() + borderw) || 2435 if ( ! insideBorder(frame(),
2435 me.y_root < (frame().y() + borderw) || 2436 me.x_root, me.y_root, borderw) &&
2436 me.x_root >= (frame().x() + (int)frame().width() + borderw) || 2437 ( !frame().externalTabMode() ||
2437 me.y_root >= (frame().y() + (int)frame().height() + borderw)) 2438 ! insideBorder(frame().tabcontainer(),
2438 && (!frame().externalTabMode() || 2439 me.x_root, me.y_root, borderw) )
2439 (me.x_root < (frame().tabcontainer().x() + borderw) || 2440
2440 me.y_root < (frame().tabcontainer().y() + borderw) || 2441 || // or if mouse was on border when it was last clicked
2441 me.x_root >= (frame().tabcontainer().x() + 2442
2442 (int)frame().tabcontainer().width() + borderw) || 2443 ! insideBorder(frame(),
2443 me.y_root >= (frame().tabcontainer().y() + 2444 m_last_button_x, m_last_button_y, borderw) &&
2444 (int)frame().tabcontainer().height() + borderw))) 2445 ( ! frame().externalTabMode() ||
2445 // or if mouse was on border when it was last clicked 2446 ! insideBorder(frame().tabcontainer(),
2446 || (m_last_button_x < (frame().x() + borderw) || 2447 m_last_button_x, m_last_button_y, borderw ) ) ) {
2447 m_last_button_y < (frame().y() + borderw) ||
2448 m_last_button_x >= (frame().x() +
2449 (int)frame().width() + borderw) ||
2450 m_last_button_y >= (frame().y() +
2451 (int)frame().height() + borderw))
2452 && (!frame().externalTabMode() ||
2453 (m_last_button_x < (frame().tabcontainer().x() + borderw) ||
2454 m_last_button_y < (frame().tabcontainer().y() + borderw) ||
2455 m_last_button_x >= (frame().tabcontainer().x() +
2456 (int)frame().tabcontainer().width() + borderw) ||
2457 m_last_button_y >= (frame().tabcontainer().y() +
2458 (int)frame().tabcontainer().height() + borderw))))
2459 return; 2448 return;
2449 }
2460 } 2450 }
2461 2451
2462 if (moving || ((me.state & Button1Mask) && functions.move && 2452 if (moving || ((me.state & Button1Mask) && functions.move &&