Skip to content

Commit

Permalink
Stop move/sizes when changing tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Jun 18, 2024
1 parent c1feb0c commit 98a12c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/movesize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,10 @@ void YFrameWindow::startMoveSize(bool doMove, bool byMouse,
}
}

bool YFrameWindow::notMoveSize() {
return hasMoveSize() == false || (endMoveSize(), true);
}

void YFrameWindow::endMoveSize() {
xapp->releaseEvents();
statusMoveSize->end();
Expand Down
7 changes: 4 additions & 3 deletions src/wmframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ void YFrameWindow::changeTab(int delta) {
void YFrameWindow::selectTab(YFrameClient* tab) {
if (hasTab(tab) == false || tab == fClient)
return;
notMoveSize();

XSizeHints *sh = client()->sizeHints();
int nw = sh ? sh->base_width + normalW * max(1, sh->width_inc) : normalW;
Expand Down Expand Up @@ -352,7 +353,7 @@ void YFrameWindow::createTab(YFrameClient* client, int place) {
void YFrameWindow::removeTab(YFrameClient* client) {
bool found = findRemove(fTabs, client);
PRECONDITION(found);
if (found) {
if (found && notMoveSize()) {
YClientContainer* conter = client->getContainer();
independer(client);
delete conter;
Expand All @@ -367,7 +368,7 @@ void YFrameWindow::removeTab(YFrameClient* client) {
}

void YFrameWindow::untab(YFrameClient* client) {
if (1 < tabCount()) {
if (1 < tabCount() && notMoveSize()) {
int i = find(fTabs, client);
PRECONDITION(0 <= i);
if (0 <= i) {
Expand Down Expand Up @@ -2981,7 +2982,7 @@ bool YFrameWindow::getInputFocusHint() {
void YFrameWindow::setWorkspace(int workspace) {
if ( ! inrange(workspace, -1, workspaceCount - 1))
return ;
if (workspace != fWinWorkspace) {
if (workspace != fWinWorkspace && notMoveSize()) {
int previous = fWinWorkspace;
int activeWS = int(manager->activeWorkspace());
int oldState = fWinState;
Expand Down
1 change: 1 addition & 0 deletions src/wmframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class YFrameWindow:
int sideX, int sideY,
int mouseXroot, int mouseYroot);
bool hasMoveSize() const { return movingWindow || sizingWindow; }
bool notMoveSize();
void endMoveSize();
void moveWindow(int newX, int newY);
void manualPlace();
Expand Down

0 comments on commit 98a12c4

Please sign in to comment.