diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2023-04-05 22:08:38 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2023-05-27 16:40:33 +0300 |
commit | ad771450f3fe9c170d8cef42147e444f2f7aaea8 (patch) | |
tree | 0b296fed6100dc178d1eff80e8709d6d4f27666e /twin/workspace.h | |
parent | 60f10cca06201053402a2af678ac59387db4b61e (diff) | |
download | tdebase-ad771450f3fe9c170d8cef42147e444f2f7aaea8.tar.gz tdebase-ad771450f3fe9c170d8cef42147e444f2f7aaea8.zip |
TWin: Active borders and snap tiling
This commit is a squash of the commits of TDE/tdebase#331.
In short, this backports some improvements to existing electric border
functionality from KDE, adds the snap tiling (or aerosnap) feature and
brings rudimentary support for active corners, which will be fully
implemented in a later PR.
The options dialog and the documentation has been updated to reflect
these changes.
Additionally, a new relevant option is introduced: an option for
restoring the original size of maximized/tiled windows when the user
starts dragging them. The option is set to be off by default,
preserving the traditional behaviour of KDE 3.x/TDE.
Last but not least, the term "electric" in relation to borders and
corners is replaced by "active" for clarity to the users.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 31335a04ed9bc01fd3ede33afde40d6f3359f2e9)
Diffstat (limited to 'twin/workspace.h')
-rw-r--r-- | twin/workspace.h | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/twin/workspace.h b/twin/workspace.h index e88e68c85..3a724a4a2 100644 --- a/twin/workspace.h +++ b/twin/workspace.h @@ -156,7 +156,10 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void clientHidden( Client* ); void clientAttentionChanged( Client* c, bool set ); - void clientMoved(const TQPoint &pos, Time time); + void checkActiveBorder(const TQPoint &pos, Time time); + void reserveActiveBorder(ActiveBorder border); + void unreserveActiveBorder(ActiveBorder border); + void reserveActiveBorderSwitching(bool reserve); /** * Returns the current virtual desktop of this workspace @@ -302,7 +305,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void requestDelayFocus( Client* ); void updateFocusMousePosition( const TQPoint& pos ); TQPoint focusMousePosition() const; - + void toggleTopDockShadows(bool on); public slots: @@ -406,6 +409,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void cleanupTemporaryRules(); void writeWindowRules(); void kipcMessage( int id, int data ); + void updateActiveBorders(); // kompmgr void setPopupClientOpacity(int v); void resetClientOpacity(); @@ -486,12 +490,10 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void tabBoxKeyPress( const KKeyNative& keyX ); void tabBoxKeyRelease( const XKeyEvent& ev ); - // electric borders - void checkElectricBorders( bool force = false ); - void createBorderWindows(); - void destroyBorderWindows(); - bool electricBorder(XEvent * e); - void raiseElectricBorders(); + // active borders + void destroyActiveBorders(); + bool activeBorderEvent(XEvent *e); + void activeBorderSwitchDesktop(ActiveBorder border, const TQPoint& pos); // ------------------ @@ -617,19 +619,17 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin TDEStartupInfo* startup; - bool electric_have_borders; - int electric_current_border; - WId electric_top_border; - WId electric_bottom_border; - WId electric_left_border; - WId electric_right_border; - int electricLeft; - int electricRight; - int electricTop; - int electricBottom; - Time electric_time_first; - Time electric_time_last; - TQPoint electric_push_point; + ActiveBorder active_current_border; + Window active_windows[ ACTIVE_BORDER_COUNT ]; + int activeLeft; + int activeRight; + int activeTop; + int activeBottom; + Time active_time_first; + Time active_time_last; + Time active_time_last_trigger; + TQPoint active_push_point; + int active_reserved[ ACTIVE_BORDER_COUNT ]; // corners/edges used by something Qt::Orientation layoutOrientation; int layoutX; @@ -663,7 +663,11 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin int maximizedWindowCounter; int topDockShadowSize;*/ //end - + + Window outline_left; + Window outline_right; + Window outline_top; + Window outline_bottom; signals: void kompmgrStarted(); void kompmgrStopped(); |