aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-06-11 13:09:44 (GMT)
committerfluxgen <fluxgen>2006-06-11 13:09:44 (GMT)
commit331a52115dfa5c681b065d226ee796e52b48fed0 (patch)
tree1bd1282d6374431369e5b1fabda314f7ae7298ec /src/Window.cc
parent9699cda56e0877d361a0a79df3a8ebeea5b36f33 (diff)
downloadfluxbox-331a52115dfa5c681b065d226ee796e52b48fed0.zip
fluxbox-331a52115dfa5c681b065d226ee796e52b48fed0.tar.bz2
support for _NET_WM_MOVERESIZE
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc54
1 files changed, 34 insertions, 20 deletions
diff --git a/src/Window.cc b/src/Window.cc
index b87a9a5..2311634 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1158,8 +1158,6 @@ void FluxboxWindow::updateTitleFromClient(WinClient &client) {
1158 m_labelbuttons[&client]->setText(client.title()); 1158 m_labelbuttons[&client]->setText(client.title());
1159 if (&client == m_client) 1159 if (&client == m_client)
1160 frame().setFocusTitle(client.title()); 1160 frame().setFocusTitle(client.title());
1161
1162 titleSig().notify();
1163 } 1161 }
1164} 1162}
1165 1163
@@ -1734,7 +1732,7 @@ void FluxboxWindow::maximize(int type) {
1734 m_last_resize_w = new_w; 1732 m_last_resize_w = new_w;
1735 m_last_resize_h = new_h; 1733 m_last_resize_h = new_h;
1736 1734
1737 ResizeCorner old_resize_corner = m_resize_corner; 1735 ResizeDirection old_resize_corner = m_resize_corner;
1738 m_resize_corner = NOCORNER; 1736 m_resize_corner = NOCORNER;
1739 fixsize(); 1737 fixsize();
1740 m_resize_corner = old_resize_corner; 1738 m_resize_corner = old_resize_corner;
@@ -2525,6 +2523,7 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2525 client.updateIconTitle(); 2523 client.updateIconTitle();
2526 case XA_WM_NAME: 2524 case XA_WM_NAME:
2527 updateTitleFromClient(client); 2525 updateTitleFromClient(client);
2526 titleSig().notify();
2528 break; 2527 break;
2529 2528
2530 case XA_WM_NORMAL_HINTS: { 2529 case XA_WM_NORMAL_HINTS: {
@@ -2774,12 +2773,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2774 !isResizing()) { 2773 !isResizing()) {
2775 2774
2776 if (! isMoving()) { 2775 if (! isMoving()) {
2777 startMoving(me.window); 2776 startMoving(me.x_root, me.y_root);
2778 // save first event point
2779 m_last_resize_x = me.x_root;
2780 m_last_resize_y = me.y_root;
2781 m_button_grab_x = me.x_root - frame().x() - frame().window().borderWidth();
2782 m_button_grab_y = me.y_root - frame().y() - frame().window().borderWidth();
2783 } else { 2777 } else {
2784 int dx = me.x_root - m_button_grab_x, 2778 int dx = me.x_root - m_button_grab_x,
2785 dy = me.y_root - m_button_grab_y; 2779 dy = me.y_root - m_button_grab_y;
@@ -2854,22 +2848,33 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2854 2848
2855 int cx = frame().width() / 2; 2849 int cx = frame().width() / 2;
2856 int cy = frame().height() / 2; 2850 int cy = frame().height() / 2;
2857 2851 ResizeDirection resize_corner = RIGHTBOTTOM;
2858 if (me.window == frame().gripRight()) 2852 if (me.window == frame().gripRight())
2859 m_resize_corner = RIGHTBOTTOM; 2853 resize_corner = RIGHTBOTTOM;
2860 else if (me.window == frame().gripLeft()) 2854 else if (me.window == frame().gripLeft())
2861 m_resize_corner = LEFTBOTTOM; 2855 resize_corner = LEFTBOTTOM;
2862 else if (screen().getResizeModel() != BScreen::QUADRANTRESIZE) { 2856 else if (screen().getResizeModel() != BScreen::QUADRANTRESIZE) {
2863 if (screen().getResizeModel() == BScreen::CENTERRESIZE) 2857 if (screen().getResizeModel() == BScreen::CENTERRESIZE)
2864 m_resize_corner = ALLCORNERS; 2858 resize_corner = ALLCORNERS;
2865 else 2859 else
2866 m_resize_corner = RIGHTBOTTOM; 2860 resize_corner = RIGHTBOTTOM;
2867 } else if (me.x < cx) 2861 } else if (me.x < cx)
2868 m_resize_corner = (me.y < cy) ? LEFTTOP : LEFTBOTTOM; 2862 resize_corner = (me.y < cy) ? LEFTTOP : LEFTBOTTOM;
2869 else 2863 else
2870 m_resize_corner = (me.y < cy) ? RIGHTTOP : RIGHTBOTTOM; 2864 resize_corner = (me.y < cy) ? RIGHTTOP : RIGHTBOTTOM;
2865
2866
2867 // We are grabbing frame window in startResizing
2868 // we need to translate coordinates to it.
2869 int start_x = me.x, start_y = me.y;
2870 Window child;
2871 XTranslateCoordinates(display,
2872 me.window, fbWindow().window(),
2873 start_x, start_y,
2874 &start_x, &start_y,
2875 &child);
2871 2876
2872 startResizing(me.window, me.x, me.y); 2877 startResizing(start_x, start_y, resize_corner);
2873 2878
2874 } else if (resizing) { 2879 } else if (resizing) {
2875 2880
@@ -3236,10 +3241,16 @@ void FluxboxWindow::setDecorationMask(unsigned int mask) {
3236 applyDecorations(); 3241 applyDecorations();
3237} 3242}
3238 3243
3239void FluxboxWindow::startMoving(Window win) { 3244void FluxboxWindow::startMoving(int x, int y) {
3240 if (s_num_grabs > 0) 3245 if (s_num_grabs > 0)
3241 return; 3246 return;
3242 3247
3248 // save first event point
3249 m_last_resize_x = x;
3250 m_last_resize_y = y;
3251 m_button_grab_x = x - frame().x() - frame().window().borderWidth();
3252 m_button_grab_y = y - frame().y() - frame().window().borderWidth();
3253
3243 moving = true; 3254 moving = true;
3244 maximized = MAX_NONE; 3255 maximized = MAX_NONE;
3245 3256
@@ -3498,11 +3509,13 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
3498} 3509}
3499 3510
3500 3511
3501void FluxboxWindow::startResizing(Window win, int x, int y) { 3512void FluxboxWindow::startResizing(int x, int y, ResizeDirection dir) {
3502 3513
3503 if (s_num_grabs > 0 || isShaded() || isIconic() ) 3514 if (s_num_grabs > 0 || isShaded() || isIconic() )
3504 return; 3515 return;
3505 3516
3517 m_resize_corner = dir;
3518
3506 resizing = true; 3519 resizing = true;
3507 maximized = MAX_NONE; 3520 maximized = MAX_NONE;
3508 3521
@@ -3511,7 +3524,8 @@ void FluxboxWindow::startResizing(Window win, int x, int y) {
3511 (m_resize_corner == RIGHTBOTTOM) ? frame().theme().lowerRightAngleCursor() : 3524 (m_resize_corner == RIGHTBOTTOM) ? frame().theme().lowerRightAngleCursor() :
3512 frame().theme().lowerLeftAngleCursor(); 3525 frame().theme().lowerLeftAngleCursor();
3513 3526
3514 grabPointer(win, false, ButtonMotionMask | ButtonReleaseMask, 3527 grabPointer(fbWindow().window(),
3528 false, ButtonMotionMask | ButtonReleaseMask,
3515 GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); 3529 GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime);
3516 3530
3517 int gx = 0, gy = 0; 3531 int gx = 0, gy = 0;