Emit a signal if the QuickTileMode changes

This commit is contained in:
Martin Gräßlin 2014-07-25 11:19:54 +02:00
parent 750f61fa55
commit d3a91b67d9
2 changed files with 7 additions and 0 deletions

View file

@ -774,6 +774,7 @@ Q_SIGNALS:
**/ **/
void blockingCompositingChanged(KWin::Client *client); void blockingCompositingChanged(KWin::Client *client);
void clientSideDecoratedChanged(); void clientSideDecoratedChanged();
void quickTileModeChanged();
private: private:
int borderLeft() const; int borderLeft() const;

View file

@ -1627,6 +1627,7 @@ void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, in
if (!ignore) { // either we're not max'd / q'tiled or the user allowed the client to break that - so break it. if (!ignore) { // either we're not max'd / q'tiled or the user allowed the client to break that - so break it.
quick_tile_mode = QuickTileNone; quick_tile_mode = QuickTileNone;
max_mode = MaximizeRestore; max_mode = MaximizeRestore;
emit quickTileModeChanged();
} else if (!app_noborder && quick_tile_mode == QuickTileNone && } else if (!app_noborder && quick_tile_mode == QuickTileNone &&
(maximizeMode() == MaximizeVertical || maximizeMode() == MaximizeHorizontal)) { (maximizeMode() == MaximizeVertical || maximizeMode() == MaximizeHorizontal)) {
// ignoring can be, because either we do, or the user does explicitly not want it. // ignoring can be, because either we do, or the user does explicitly not want it.
@ -2372,6 +2373,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
updateAllowedActions(); updateAllowedActions();
updateWindowRules(Rules::MaximizeVert|Rules::MaximizeHoriz|Rules::Position|Rules::Size); updateWindowRules(Rules::MaximizeVert|Rules::MaximizeHoriz|Rules::Position|Rules::Size);
emit quickTileModeChanged();
} }
bool Client::isFullScreenable(bool fullscreen_hack) const bool Client::isFullScreenable(bool fullscreen_hack) const
@ -2605,6 +2607,7 @@ bool Client::startMoveResize()
if (quick_tile_mode != QuickTileNone && mode != PositionCenter) { // Cannot use isResize() yet if (quick_tile_mode != QuickTileNone && mode != PositionCenter) { // Cannot use isResize() yet
// Exit quick tile mode when the user attempts to resize a tiled window // Exit quick tile mode when the user attempts to resize a tiled window
quick_tile_mode = QuickTileNone; // Do so without restoring original geometry quick_tile_mode = QuickTileNone; // Do so without restoring original geometry
emit quickTileModeChanged();
} }
s_haveResizeEffect = effects && static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::Resize); s_haveResizeEffect = effects && static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::Resize);
@ -3151,6 +3154,7 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard)
} }
quick_tile_mode = QuickTileMaximize; quick_tile_mode = QuickTileMaximize;
} }
emit quickTileModeChanged();
return; return;
} }
@ -3178,6 +3182,7 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard)
} }
// Store the mode change // Store the mode change
quick_tile_mode = mode; quick_tile_mode = mode;
emit quickTileModeChanged();
return; return;
} }
@ -3258,6 +3263,7 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard)
setGeometry(geom_restore, geom_mode); setGeometry(geom_restore, geom_mode);
checkWorkspacePosition(); // Just in case it's a different screen checkWorkspacePosition(); // Just in case it's a different screen
} }
emit quickTileModeChanged();
} }
void Client::sendToScreen(int newScreen) void Client::sendToScreen(int newScreen)