Add window move when normalizing

This commit is contained in:
Ximi1970
2024-04-08 22:56:03 +02:00
parent c3f54da0a2
commit c8d8720583
3 changed files with 21 additions and 19 deletions

View File

@@ -23,7 +23,10 @@ QT += core gui widgets
unix:!macx: {
contains(DEFINES,KDE_INTEGRATION) {
lessThan(QT_MAJOR_VERSION, 6): {
QT += dbus KNotifications
QT += dbus
INCLUDEPATH += /usr/include/KF5/KNotifications
LIBS += -lKF5Notifications
}
greaterThan(QT_MAJOR_VERSION, 5): {
INCLUDEPATH += /usr/include/KF6/KStatusNotifierItem

View File

@@ -432,6 +432,11 @@ void WindowCtrlUnix::minimizeWindowToTaskbar( quint64 window )
emit signalConsole( "Minimize to taskbar" );
#endif
/*
* Store the current window positions
*/
updatePositions();
/*
* Save the hints
*/
@@ -477,6 +482,11 @@ void WindowCtrlUnix::minimizeWindowToTray( quint64 window )
emit signalConsole( "Minimize to system tray" );
#endif
/*
* Store the current window positions
*/
updatePositions();
/*
* Save the hints
*/
@@ -611,6 +621,13 @@ void WindowCtrlUnix::normalizeWindow( quint64 window )
*/
Sync( m_display );
/*
* Move the window to the last recorded position, seems to be needed for wayland
*/
QPoint pos = m_tb_window_positions[ window ];
MoveWindow( m_display, window, pos.x(), pos.y() );
Flush( m_display );
/*
* Let us wait a bit, maybe this helps...
*/

View File

@@ -174,15 +174,6 @@ void WindowCtrl::slotWindowState( Preferences::WindowState state, int id )
QList< quint64 > win_ids = getWinIds();
#ifdef Q_OS_UNIX
/*
* Update window positions
*/
updatePositions();
#endif
/*
* Minimize/dock all
*/
@@ -253,15 +244,6 @@ void WindowCtrl::slotShowHide()
*/
normalizeWindowsHidden();
#endif
#ifdef Q_OS_UNIX
/*
* Update the positions
*/
updatePositions();
#endif
TargetType target_type = TargetType::TYPE_WINDOW_TO_SYSTEMTRAY;