diff --git a/desktop/desktop.cpp b/desktop/desktop.cpp index 682f447..7092484 100644 --- a/desktop/desktop.cpp +++ b/desktop/desktop.cpp @@ -967,12 +967,16 @@ int WindowTabBandMessage(EsElement *element, EsMessage *message) { EsMenuAddItem(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(DesktopSnapWindowLeft), [] (EsMenu *, EsGeneric context) { - WindowSnap((EsWindow *) context.p, false, false, SNAP_EDGE_LEFT); + EsWindow *window = (EsWindow *) context.p; + if (window->isMaximised) WindowRestore(window, false /* we immediately move the window after this */); + WindowSnap(window, false, false, SNAP_EDGE_LEFT); }, band->window); EsMenuAddItem(menu, ES_FLAGS_DEFAULT, INTERFACE_STRING(DesktopSnapWindowRight), [] (EsMenu *, EsGeneric context) { - WindowSnap((EsWindow *) context.p, false, false, SNAP_EDGE_RIGHT); + EsWindow *window = (EsWindow *) context.p; + if (window->isMaximised) WindowRestore(window, false /* we immediately move the window after this */); + WindowSnap(window, false, false, SNAP_EDGE_RIGHT); }, band->window); EsMenuShow(menu); diff --git a/desktop/gui.cpp b/desktop/gui.cpp index 6f684e9..3106851 100644 --- a/desktop/gui.cpp +++ b/desktop/gui.cpp @@ -858,6 +858,9 @@ int ProcessRootMessage(EsElement *element, EsMessage *message) { if (window->windowStyle == ES_WINDOW_MENU) { EsAssert(window->state & UI_STATE_MENU_EXITING); } + } else if (message->type == ES_MSG_MOUSE_LEFT_DOWN || message->type == ES_MSG_MOUSE_MIDDLE_DOWN || message->type == ES_MSG_MOUSE_RIGHT_DOWN) { + // Make sure that something can be dragged, otherwise elements will get mouse dragged messages when the mouse moves over them. + response = ES_HANDLED; } return response;