aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/Window.cc b/src/Window.cc
index daea663..9923a45 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -299,7 +299,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client):
299 299
300 // add the window to the focus list 300 // add the window to the focus list
301 // always add to front on startup to keep the focus order the same 301 // always add to front on startup to keep the focus order the same
302 if (m_focused || Fluxbox::instance()->isStartup()) 302 if (isFocused() || Fluxbox::instance()->isStartup())
303 screen().focusControl().addFocusWinFront(*this); 303 screen().focusControl().addFocusWinFront(*this);
304 else 304 else
305 screen().focusControl().addFocusWinBack(*this); 305 screen().focusControl().addFocusWinBack(*this);
@@ -599,8 +599,8 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) {
599 delete old_win; 599 delete old_win;
600 600
601 } else { // client.fbwindow() == 0 601 } else { // client.fbwindow() == 0
602 associateClient(client);
603 602
603 associateClient(client);
604 moveResizeClient(client); 604 moveResizeClient(client);
605 605
606 // right now, this block only happens with new windows or on restart 606 // right now, this block only happens with new windows or on restart
@@ -2390,10 +2390,13 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2390 2390
2391 // undraw rectangle before warping workspaces 2391 // undraw rectangle before warping workspaces
2392 if (!screen().doOpaqueMove()) { 2392 if (!screen().doOpaqueMove()) {
2393 parent().drawRectangle(screen().rootTheme()->opGC(), 2393 int bw = static_cast<int>(frame().window().borderWidth());
2394 m_last_move_x, m_last_move_y, 2394 int w = static_cast<int>(frame().width()) + 2*bw -1;
2395 frame().width() + 2*frame().window().borderWidth()-1, 2395 int h = static_cast<int>(frame().height()) + 2*bw - 1;
2396 frame().height() + 2*frame().window().borderWidth()-1); 2396 if (w > 0 && h > 0) {
2397 parent().drawRectangle(screen().rootTheme()->opGC(),
2398 m_last_move_x, m_last_move_y, w, h);
2399 }
2397 } 2400 }
2398 2401
2399 if (moved_x && screen().isWorkspaceWarping()) { 2402 if (moved_x && screen().isWorkspaceWarping()) {
@@ -2444,10 +2447,12 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2444 // do not update display if another motion event is already pending 2447 // do not update display if another motion event is already pending
2445 2448
2446 if (!screen().doOpaqueMove()) { 2449 if (!screen().doOpaqueMove()) {
2447 parent().drawRectangle(screen().rootTheme()->opGC(), 2450 int bw = frame().window().borderWidth();
2448 dx, dy, 2451 int w = static_cast<int>(frame().width()) + 2*bw - 1;
2449 frame().width() + 2*frame().window().borderWidth()-1, 2452 int h = static_cast<int>(frame().height()) + 2*bw - 1;
2450 frame().height() + 2*frame().window().borderWidth()-1); 2453 if (w > 0 && h > 0) {
2454 parent().drawRectangle(screen().rootTheme()->opGC(), dx, dy, w, h);
2455 }
2451 m_last_move_x = dx; 2456 m_last_move_x = dx;
2452 m_last_move_y = dy; 2457 m_last_move_y = dy;
2453 } else { 2458 } else {