-void BlackboxWindow::motionNotifyEvent(const XMotionEvent *me) {
- // get the button that is being used
- // get the proper state, without the button that is being used
- unsigned int button;
- unsigned int state;
- if (me->state & Button1Mask) {
- button = Button1;
- state = me->state & ~Button1Mask;
- } else if (me->state & Button2Mask) {
- button = Button2;
- state = me->state & ~Button2Mask;
- } else if (me->state & Button3Mask) {
- button = Button3;
- state = me->state & ~Button3Mask;
- } else if (me->state & Button4Mask) {
- button = Button4;
- state = me->state & ~Button4Mask;
- } else if (me->state & Button5Mask) {
- button = Button5;
- state = me->state & ~Button5Mask;
- } else {
- return;
- }
-
- if (flags.moving) {
- doMove(me->x_root, me->y_root);
- } else if (flags.resizing) {
- doResize(me->x_root, me->y_root);
- } else {
- if (frame.title == me->window || frame.label == me->window)
- input->doAction(this, button, state, BInput::WindowTitleDrag);
- else if (frame.handle == me->window)
- input->doAction(this, button, state, BInput::WindowHandleDrag);
- else if (frame.left_grip == me->window)
- input->doAction(this, button, state, BInput::WindowLeftGripDrag);
- else if (frame.right_grip == me->window)
- input->doAction(this, button, state, BInput::WindowRightGripDrag);
- else if (frame.window == me->window)
- input->doAction(this, button, state, BInput::WindowDrag);
- }
-}
-