#endif // SLIT
#include "Util.h"
+#include <iostream>
+using namespace std;
+
/*
* Initializes the class with default values/the window's set initial values.
*/
XSetInputFocus(display, screen->getRootWindow(),
RevertToNone, CurrentTime);
- openbox.setFocusedWindow(this);
+ openbox.focusWindow(this);
if (flags.send_focus_message) {
XEvent ce;
// after the window is mapped, we need to start interactively moving it
if (initial && place_window &&
screen->placementPolicy() == BScreen::ClickMousePlacement) {
- // if the last window wasn't placed yet, or we're just moving a window
- // already, finish off that move cleanly
- OpenboxWindow *w = openbox.getFocusedWindow();
- if (w != (OpenboxWindow *) 0 && w->flags.moving)
- w->endMove();
-
int x, y, rx, ry;
Window c, r;
unsigned int m;
void OpenboxWindow::maximize(unsigned int button) {
+ if (flags.moving)
+ endMove();
+
// handle case where menu is open then the max button is used instead
if (windowmenu && windowmenu->isVisible()) windowmenu->hide();
openbox.grab();
if (! validateClient()) return;
+ if (flags.moving)
+ endMove();
+
XChangeSaveSet(display, client.window, SetModeDelete);
XSelectInput(display, client.window, NoEventMask);
void OpenboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) {
if (de->window == client.window) {
+ if (flags.moving)
+ endMove();
XUnmapWindow(display, frame.window);
delete this;
void OpenboxWindow::startMove(int x, int y) {
ASSERT(!flags.moving);
+ // make sure only one window is moving at a time
+ OpenboxWindow *w = openbox.getMaskedWindow();
+ if (w != (OpenboxWindow *) 0 && w->flags.moving)
+ w->endMove();
+
XGrabPointer(display, frame.window, False, PointerMotionMask |
ButtonReleaseMask, GrabModeAsync, GrabModeAsync,
None, openbox.getMoveCursor(), CurrentTime);