diff --git a/app/SysTray-X/SysTray-X-app/preferences.cpp b/app/SysTray-X/SysTray-X-app/preferences.cpp
index d44ff32..b469d0d 100644
--- a/app/SysTray-X/SysTray-X-app/preferences.cpp
+++ b/app/SysTray-X/SysTray-X-app/preferences.cpp
@@ -49,6 +49,9 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
m_close_type = PREF_MINIMIZE_MAIN_TRAY_CLOSE_CHILDREN_WINDOWS;
m_minimize_icon_type = PREF_MINIMIZE_TRAY_ICON;
+ m_window_positions_correction = false;
+ m_window_positions_correction_type = PREF_NO_CORRECTION;
+
m_startup_type = PREF_START_DEFAULT;
m_restore_window_positions = false;
@@ -420,6 +423,58 @@ void Preferences::setMinimizeIconType( MinimizeIconType minimize_icon_type )
}
+/*
+ * Get the window positions correction state
+ */
+bool Preferences::getWindowPositionsCorrection() const
+{
+ return m_window_positions_correction;
+}
+
+
+/*
+ * Set the window positions correction state
+ */
+void Preferences::setWindowPositionsCorrection( bool state )
+{
+ if( m_window_positions_correction != state )
+ {
+ m_window_positions_correction = state;
+
+ /*
+ * Tell the world the new preference
+ */
+ emit signalWindowPositionsCorrectionChange();
+ }
+}
+
+
+/*
+ * Get the window positions correction type
+ */
+Preferences::WindowPositionsCorrectionType Preferences::getWindowPositionsCorrectionType() const
+{
+ return m_window_positions_correction_type;
+}
+
+
+/*
+ * Set the minimize type.
+ */
+void Preferences::setWindowPositionsCorrectionType( WindowPositionsCorrectionType window_positions_correction_type )
+{
+ if( m_window_positions_correction_type != window_positions_correction_type)
+ {
+ m_window_positions_correction_type = window_positions_correction_type;
+
+ /*
+ * Tell the world the new preference
+ */
+ emit signalWindowPositionsCorrectionTypeChange();
+ }
+}
+
+
/*
* Get the start minmized pref.
*/
diff --git a/app/SysTray-X/SysTray-X-app/preferences.h b/app/SysTray-X/SysTray-X-app/preferences.h
index b08f16f..80b32aa 100644
--- a/app/SysTray-X/SysTray-X-app/preferences.h
+++ b/app/SysTray-X/SysTray-X-app/preferences.h
@@ -53,6 +53,15 @@ class Preferences : public QObject
PREF_MINIMIZE_TRAY_ICON
};
+ /*
+ * Position correction
+ */
+ enum WindowPositionsCorrectionType {
+ PREF_NO_CORRECTION = 0,
+ PREF_ADD_CORRECTION,
+ PREF_SUBTRACT_CORRECTION
+ };
+
/*
* Startup types
*/
@@ -258,6 +267,34 @@ class Preferences : public QObject
*/
void setMinimizeIconType( MinimizeIconType minimize_icon_type );
+ /**
+ * @brief getWindowPositionsCorrection. Get the window positions correction state.
+ *
+ * @return The state.
+ */
+ bool getWindowPositionsCorrection() const;
+
+ /**
+ * @brief setWindowPositionsCorrection. Set the window positions correction state.
+ *
+ * @param state The state.
+ */
+ void setWindowPositionsCorrection( bool state );
+
+ /**
+ * @brief getWindowPositionsCorrectionType. Get the window positions correction type
+ *
+ * @return the window positions correction type.
+ */
+ WindowPositionsCorrectionType getWindowPositionsCorrectionType() const;
+
+ /**
+ * @brief setWindowPositionsCorrectionType. Set the window positions correction type.
+ *
+ * @param window_positions_correction_type The window positions correction type.
+ */
+ void setWindowPositionsCorrectionType( WindowPositionsCorrectionType window_positions_correction_type );
+
/**
* @brief getDefaultIconType. Get the default icon type.
*
@@ -684,6 +721,16 @@ class Preferences : public QObject
*/
void signalMinimizeIconTypeChange();
+ /**
+ * @brief signalWindowPositionsCorrectionChange. Signal a window positions correction change.
+ */
+ void signalWindowPositionsCorrectionChange();
+
+ /**
+ * @brief signalWindowPositionsCorrectionTypeChange. Signal a window positions correction type change.
+ */
+ void signalWindowPositionsCorrectionTypeChange();
+
/**
* @brief signalStartupTypeChange. Signal a startup type change.
*/
@@ -890,6 +937,16 @@ class Preferences : public QObject
*/
MinimizeIconType m_minimize_icon_type;
+ /**
+ * @brief m_window_positions_correction
+ */
+ bool m_window_positions_correction;
+
+ /**
+ * @brief m_window_positions_correction_type
+ */
+ WindowPositionsCorrectionType m_window_positions_correction_type;
+
/**
* @brief m_startup_type. Startup TB preference.
*/
diff --git a/app/SysTray-X/SysTray-X-app/preferences.ui b/app/SysTray-X/SysTray-X-app/preferences.ui
index 7bea8d1..9b88e96 100644
--- a/app/SysTray-X/SysTray-X-app/preferences.ui
+++ b/app/SysTray-X/SysTray-X-app/preferences.ui
@@ -6,8 +6,8 @@
0
0
- 608
- 468
+ 558
+ 519
@@ -25,315 +25,359 @@
-
-
-
- 0
-
-
-
- Windows
-
-
-
-
-
-
-
-
-
- Close
-
-
-
-
-
-
- Default close
-
-
- closeTypeGroup
-
-
-
- -
-
-
- Minimize main to tray, close children
-
-
- true
-
-
- closeTypeGroup
-
-
-
- -
-
-
- Minimize all windows to tray
-
-
- false
-
-
- closeTypeGroup
-
-
-
- -
-
-
- Minimize main, close children
-
-
- false
-
-
- closeTypeGroup
-
-
-
- -
-
-
- Minimize all windows
-
-
- false
-
-
- closeTypeGroup
-
-
-
-
-
-
- -
-
-
- Startup
-
-
-
-
-
-
- Default startup
-
-
- true
-
-
- startupTypeGroup
-
-
-
- -
-
-
- Start application minimized
-
-
- startupTypeGroup
-
-
-
- -
-
-
- Start application in tray
-
-
- false
-
-
- startupTypeGroup
-
-
-
-
-
-
- -
-
-
- Restore startup positions
-
-
-
- -
-
+
+
-
+
+
+ 0
+
+
+
+ Windows
+
+
+
-
+
- Qt::Vertical
+ Qt::Horizontal
- 20
- 40
+ 2
+ 20
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 2
- 20
-
-
-
-
- -
-
-
-
-
-
- Minimize
-
-
-
-
-
-
- Default minimize
-
-
- false
-
-
- minimizeTypeGroup
-
-
-
- -
-
-
- Minimize to tray
-
-
- true
-
-
- minimizeTypeGroup
-
-
-
- -
-
-
- Minimize to tray, method 2
-
-
- minimizeTypeGroup
-
-
-
-
-
+ -
+
+
-
+
+
+ Minimize
+
+
+
-
+
+
+ Default minimize
+
+
+ false
+
+
+ minimizeTypeGroup
+
+
+
+ -
+
+
+ Minimize to tray
+
+
+ true
+
+
+ minimizeTypeGroup
+
+
+
+ -
+
+
+ Minimize to tray, method 2
+
+
+ minimizeTypeGroup
+
+
+
+
+
+
+ -
+
+
+ Icon
+
+
+
-
+
+
+ Default minimize
+
+
+ false
+
+
+ minimizeIconTypeGroup
+
+
+
+ -
+
+
+ Minimize to tray
+
+
+ true
+
+
+ minimizeIconTypeGroup
+
+
+
+
+
+
+ -
+
+
+ Position
+
+
+
-
+
+
-
+
+
+ Correct window positions
+
+
+
+ -
+
+
-
+
+
+ No titlebar correction
+
+
+ true
+
+
+ positionGroup
+
+
+
+ -
+
+
+ Add titlebar size
+
+
+ positionGroup
+
+
+
+ -
+
+
+ Subtract titlebar size
+
+
+ positionGroup
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 17
+
+
+
+
+
- -
-
-
- Icon
-
-
-
-
-
-
- Default minimize
-
-
- false
-
-
- minimizeIconTypeGroup
-
-
-
- -
-
-
- Minimize to tray
-
-
- true
-
-
- minimizeIconTypeGroup
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
+
-
+
+
-
+
+
+ Close
+
+
+
-
+
+
+ Default close
+
+
+ closeTypeGroup
+
+
+
+ -
+
+
+ Minimize main to tray, close children
+
+
+ true
+
+
+ closeTypeGroup
+
+
+
+ -
+
+
+ Minimize all windows to tray
+
+
+ false
+
+
+ closeTypeGroup
+
+
+
+ -
+
+
+ Minimize main, close children
+
+
+ false
+
+
+ closeTypeGroup
+
+
+
+ -
+
+
+ Minimize all windows
+
+
+ false
+
+
+ closeTypeGroup
+
+
+
+
+
+
+ -
+
+
+ Startup
+
+
+
-
+
+
+ Default startup
+
+
+ true
+
+
+ startupTypeGroup
+
+
+
+ -
+
+
+ Start application minimized
+
+
+ startupTypeGroup
+
+
+
+ -
+
+
+ PushButton
+
+
+
+ -
+
+
+ Start application in tray
+
+
+ false
+
+
+ startupTypeGroup
+
+
+
+
+
+
+ -
+
+
+ Restore startup positions
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
-
-
-
-
-
- Icon
-
-
- -
-
-
- Default icon
-
-
-
-
-
-
- Icon
-
-
-
-
-
+
+
+
+ Icon
+
+
+ -
+
+
+ Default icon
+
+
+
-
+
+
+ Icon
+
+
-
-
-
- Default Thunderbird
-
-
- true
-
-
- defaultIconTypeGroup
-
-
-
- -
-
-
- Lookthrough icon
-
-
- defaultIconTypeGroup
-
-
-
- -
-
+
-
-
+
- Custom icon
+ Default Thunderbird
+
+
+ true
defaultIconTypeGroup
@@ -341,14 +385,163 @@
-
-
+
+
+ Lookthrough icon
+
+
+ defaultIconTypeGroup
+
+
+
+ -
+
+
-
+
+
+ Custom icon
+
+
+ defaultIconTypeGroup
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Choose
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ KDE integration (Hide)
+
+
+ false
+
+
+
+
+
+
+ -
+
+
+ Mail notification icon
+
+
+
-
+
+
+ Icon
+
+
+
-
+
+
+ QLayout::SetFixedSize
+
+
-
+
+
+ Blank icon
+
+
+ true
+
+
+ iconTypeGroup
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+ QLayout::SetFixedSize
+
+
-
+
+
+ New mail icon
+
+
+ iconTypeGroup
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+ QLayout::SetMaximumSize
+
+
-
+
+
+ Custom icon
+
+
+ iconTypeGroup
+
+
+
+ -
+
-
-
+
Choose
@@ -359,671 +552,413 @@
-
-
-
-
-
- -
-
-
- KDE integration (Hide)
-
-
- false
-
-
-
-
-
-
- -
-
-
- Mail notification icon
-
-
-
-
-
-
- Icon
-
-
-
-
-
-
- QLayout::SetFixedSize
-
-
-
-
- Blank icon
-
-
- true
-
-
- iconTypeGroup
-
-
+
+
-
+
+
+ No icon
+
+
+ iconTypeGroup
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
+
+
-
+
+
+ Default Thunderbird
+
+
+ iconTypeGroup
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
- -
-
-
- QLayout::SetFixedSize
-
-
-
-
-
- New mail icon
-
-
- iconTypeGroup
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
- QLayout::SetMaximumSize
-
-
-
-
-
- Custom icon
-
-
- iconTypeGroup
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- Choose
-
-
- false
-
-
-
-
-
- -
-
-
-
-
-
- No icon
-
-
- iconTypeGroup
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
-
-
-
- Default Thunderbird
-
-
- iconTypeGroup
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
-
- -
-
-
- Invert icon
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 6
- 20
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 80
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 80
-
-
-
-
-
-
-
-
- Count
-
-
- -
-
-
-
-
-
- Show message count
-
-
- true
-
+
+
+ -
+
+
+ Invert icon
+
+
+
+
- -
-
-
- Show new indicator
+
-
+
+
+ Qt::Horizontal
-
+
+
+ 6
+ 20
+
+
+
- -
-
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 80
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 80
+
+
+
+
+
+
+
+
+ Count
+
+
+ -
+
-
-
+
- Startup delay
+ Show message count
+
+
+ true
-
-
-
- 0
-
-
- 99
-
-
- 5
+
+
+ Show new indicator
+ -
+
+
-
+
+
+ Startup delay
+
+
+
+ -
+
+
+ 0
+
+
+ 99
+
+
+ 5
+
+
+
+
+
-
-
- -
-
-
- Count type
-
-
-
-
-
-
-
-
-
- Unread
-
-
- true
-
-
- countTypeGroup
-
-
-
- -
-
-
- New
-
-
- countTypeGroup
-
-
-
-
-
-
-
-
- -
-
-
- Number properties
-
-
-
-
-
-
-
-
-
- Margins (left, top, right, bottom):
-
-
-
- -
-
+
-
+
+
+ Count type
+
+
+
-
+
-
-
-
- 999
-
-
-
- -
-
-
- 999
-
-
-
- -
-
-
- 999
-
-
-
- -
-
-
- 999
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
+
- Number color
-
-
-
- -
-
-
- Qt::NoFocus
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- Number size
-
-
-
- -
-
-
- 1
-
-
- 999
-
-
- 10
-
-
-
-
-
- -
-
-
-
-
-
- Alignment
-
-
-
- -
-
-
- 4
-
-
-
-
- Top left
-
-
- -
-
- Top centre
-
-
- -
-
- Top right
-
-
- -
-
- Middle left
-
-
- -
-
- Middle centre
-
-
- -
-
- Middle right
-
-
- -
-
- Bottom left
-
-
- -
-
- Bottom centre
-
-
- -
-
- Bottom right
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- New indicator
-
-
-
-
-
-
-
-
-
- Icon round
-
-
- newIndicatorTypeGroup
-
-
-
- -
-
-
- Icon star
-
-
- newIndicatorTypeGroup
-
-
-
- -
-
-
-
-
-
- Shade
+ Unread
true
+
+ countTypeGroup
+
+
+
+ -
+
+
+ New
+
+
+ countTypeGroup
+
+
+
+
+
+
+
+
+ -
+
+
+ Number properties
+
+
+
-
+
+
-
+
+
+ Margins (left, top, right, bottom):
+
+
+
+ -
+
+
-
+
+
+ 999
+
+
+
+ -
+
+
+ 999
+
+
+
+ -
+
+
+ 999
+
+
+
+ -
+
+
+ 999
+
+
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+ Number color
+
+
+
+ -
+
+
+ Qt::NoFocus
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ Number size
+
+
+
+ -
+
+
+ 1
+
+
+ 999
+
+
+ 10
+
+
+
+
+
+ -
+
+
-
+
+
+ Alignment
+
+
+
+ -
+
+
+ 4
+
+
-
+
+ Top left
+
+
+ -
+
+ Top centre
+
+
+ -
+
+ Top right
+
+
+ -
+
+ Middle left
+
+
+ -
+
+ Middle centre
+
+
+ -
+
+ Middle right
+
+
+ -
+
+ Bottom left
+
+
+ -
+
+ Bottom centre
+
+
+ -
+
+ Bottom right
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ New indicator
+
+
+
-
+
+
-
+
+
+ Icon round
+
newIndicatorTypeGroup
-
-
+
-
+ Icon star
+
+ newIndicatorTypeGroup
+
-
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 104
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 64
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Special options
-
-
-
-
-
-
- API count method
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
-
-
- Apps
-
-
- -
-
-
-
-
-
- Close application
-
-
-
-
-
-
-
+
-
-
-
- -
-
+
- Browse...
+ Shade
-
-
-
-
- -
-
-
-
-
-
- Arguments:
+
+ true
+
+ newIndicatorTypeGroup
+
-
-
+
+
+
+
+
@@ -1032,259 +967,392 @@
- -
-
-
- Start application
+
-
+
+
+ Qt::Horizontal
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- Browse...
-
-
-
-
-
- -
-
-
-
-
-
- Arguments:
-
-
-
- -
-
-
-
-
-
-
-
-
+
+
+ 40
+ 20
+
+
+
- -
-
+
-
+
Qt::Vertical
20
- 40
+ 104
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 64
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Special options
+
+
+
-
+
+
+ API count method
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
-
-
-
-
-
- Mail
-
-
- -
-
-
- Use the preferences dialog in Thunderbird to select the accounts and folders
-
-
- true
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 265
- 20
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 464
-
-
-
-
-
-
-
-
- Shortcuts
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
- Current show / hide shortcut:
-
-
-
- -
-
-
-
+
+
+
+ Apps
+
+
+ -
+
+
-
+
+
+ Close application
+
+
+
-
+
+
-
+
+
-
+
+
+ -
+
+
+ Browse...
+
+
+
+
+
+ -
+
+
-
+
+
+ Arguments:
+
+
+
+ -
+
+
+
+
+
+
+
+
- -
-
+
-
+
+
+ Start application
+
+
+
-
+
+
-
+
+
-
+
+
+ -
+
+
+ Browse...
+
+
+
+
+
+ -
+
+
-
+
+
+ Arguments:
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+ -
+
- Qt::Horizontal
+ Qt::Vertical
- 40
- 20
+ 20
+ 40
- -
-
+
+
+
+
+ Mail
+
+
+ -
+
+
+ Use the preferences dialog in Thunderbird to select the accounts and folders
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 265
+ 20
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 464
+
+
+
+
+
+
+
+
+ Shortcuts
+
+
+ -
+
-
-
-
- New show / hide shortcut:
-
-
+
+
-
+
+
-
+
+
+ Current show / hide shortcut:
+
+
+
+ -
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
-
-
-
-
-
-
- -
-
-
- Clear
-
-
+
+
-
+
+
+ New show / hide shortcut:
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Clear
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 297
+
+
+
+
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 297
-
-
-
-
-
-
-
-
- Debug
-
-
- -
-
-
- Display debug window
-
-
-
- -
-
+
+
+
+ Debug
+
+
+ -
+
+
+ Display debug window
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 358
+ 20
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 485
+
+
+
+
+
+
+
+
+ -
+
+
-
+
Qt::Horizontal
- 358
+ 369
20
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 485
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 369
- 20
-
-
-
-
- -
-
-
-
-
- Cancel
-
-
-
- -
-
-
- Save
-
-
+
+
-
+
+
+ Cancel
+
+
+
+ -
+
+
+ Save
+
+
+
+
@@ -1297,13 +1365,14 @@
-
-
-
+
-
-
+
+
+
+
+
diff --git a/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp b/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp
index 21b0eff..9bb86eb 100644
--- a/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp
+++ b/app/SysTray-X/SysTray-X-app/preferencesdialog.cpp
@@ -56,7 +56,7 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
m_ui->minimizeMethod2RadioButton->hide();
/*
- * Set minimize type button Ids
+ * Set minimize icon type button Ids
*/
m_ui->minimizeIconTypeGroup->setId( m_ui->defaultMinimizeIconRadioButton, Preferences::PREF_DEFAULT_MINIMIZE_ICON);
m_ui->minimizeIconTypeGroup->setId( m_ui->minimizeTrayIconRadioButton, Preferences::PREF_MINIMIZE_TRAY_ICON );
@@ -68,9 +68,17 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
m_ui->startupTypeGroup->setId( m_ui->startMinimizedRadioButton, Preferences::PREF_START_MINIMIZED);
m_ui->startupTypeGroup->setId( m_ui->startDockedRadioButton, Preferences::PREF_START_DOCKED );
+ /*
+ * Set position button Ids
+ */
+ m_ui->positionGroup->setId( m_ui->noTitlebarCorrectionRadioButton, Preferences::PREF_NO_CORRECTION);
+ m_ui->positionGroup->setId( m_ui->addTitlebarCorrectionRadioButton, Preferences::PREF_ADD_CORRECTION );
+ m_ui->positionGroup->setId( m_ui->subtractTitlebarCorrectionRadioButton, Preferences::PREF_SUBTRACT_CORRECTION );
+
#ifdef Q_OS_WIN
m_ui->hideDefaultIconCheckBox->hide();
+ m_ui->positionGroupBox->hide();
m_ui->restorePositionscheckBox->hide();
#endif
@@ -299,6 +307,24 @@ void PreferencesDialog::setMinimizeIconType( Preferences::MinimizeIconType mi
}
+/*
+ * Set the positions correction state
+ */
+void PreferencesDialog::setWindowPositionsCorrection( bool state )
+{
+ m_ui->correctWinPosCheckBox->setChecked( state );
+}
+
+
+/*
+ * Set the position correction
+ */
+void PreferencesDialog::setWindowPositionsCorrectionType( Preferences::WindowPositionsCorrectionType position_correction )
+{
+ ( m_ui->positionGroup->button( position_correction ) )->setChecked( true );
+}
+
+
/*
* Set the startup type
*/
@@ -631,6 +657,10 @@ void PreferencesDialog::slotAccept()
m_pref->setMinimizeType( static_cast< Preferences::MinimizeType >( m_ui->minimizeTypeGroup->checkedId() ) );
m_pref->setMinimizeIconType( static_cast< Preferences::MinimizeIconType >( m_ui->minimizeIconTypeGroup->checkedId() ) );
+
+ m_pref->setWindowPositionsCorrection( m_ui->correctWinPosCheckBox->isChecked() );
+ m_pref->setWindowPositionsCorrectionType( static_cast< Preferences::WindowPositionsCorrectionType >( m_ui->positionGroup->checkedId() ) );
+
m_pref->setStartupType( static_cast< Preferences::StartupType >( m_ui->startupTypeGroup->checkedId() ) );
m_pref->setRestoreWindowPositions( m_ui->restorePositionscheckBox->isChecked() );
m_pref->setCloseType( static_cast< Preferences::CloseType >( m_ui->closeTypeGroup->checkedId() ) );
@@ -699,6 +729,8 @@ void PreferencesDialog::slotReject()
setMinimizeType( m_pref->getMinimizeType() );
setMinimizeIconType( m_pref->getMinimizeIconType() );
+ setWindowPositionsCorrection( m_pref->getWindowPositionsCorrection() );
+ setWindowPositionsCorrectionType( m_pref->getWindowPositionsCorrectionType() );
setStartupType( m_pref->getStartupType() );
setRestoreWindowPositions( m_pref->getRestoreWindowPositions() );
setCloseType( m_pref->getCloseType() );
diff --git a/app/SysTray-X/SysTray-X-app/preferencesdialog.h b/app/SysTray-X/SysTray-X-app/preferencesdialog.h
index 713fe15..91e72cf 100644
--- a/app/SysTray-X/SysTray-X-app/preferencesdialog.h
+++ b/app/SysTray-X/SysTray-X-app/preferencesdialog.h
@@ -83,6 +83,20 @@ class PreferencesDialog : public QDialog
*/
void setMinimizeIconType( Preferences::MinimizeIconType minimize_icon_type );
+ /**
+ * @brief setWindowPositionsCorrection. Set the window postions correction state.
+ *
+ * @param state The state.
+ */
+ void setWindowPositionsCorrection( bool state );
+
+ /**
+ * @brief setWindowPositionsCorrectionType. Set the window positions correction type.
+ *
+ * @param position_correction The correction type.
+ */
+ void setWindowPositionsCorrectionType( Preferences::WindowPositionsCorrectionType position_correction );
+
/**
* @brief setStartupType. Set the startup type.
*
diff --git a/app/SysTray-X/SysTray-X-app/windowctrl-unix.cpp b/app/SysTray-X/SysTray-X-app/windowctrl-unix.cpp
index 6cea9bc..8576f17 100644
--- a/app/SysTray-X/SysTray-X-app/windowctrl-unix.cpp
+++ b/app/SysTray-X/SysTray-X-app/windowctrl-unix.cpp
@@ -403,11 +403,34 @@ void WindowCtrlUnix::updatePositions()
int y3;
GetWindowPosition( m_display, window, &x, &y, &x1, &y1, &x2, &y2, &x3, &y3 );
+ /*
+ * Apply the requested correction
+ */
+ QPoint point;
+ switch( m_pref->getWindowPositionsCorrectionType() )
+ {
+ case Preferences::PREF_NO_CORRECTION:
+ {
+ point = QPoint( x, y );
+ break;
+ }
+
+ case Preferences::PREF_ADD_CORRECTION:
+ {
+ point = QPoint( x + left, y + top );
+ break;
+ }
+
+ case Preferences::PREF_SUBTRACT_CORRECTION:
+ {
+ point = QPoint( x - left, y - top );
+ break;
+ }
+ }
+
/*
* Update the list?
*/
- QPoint point = QPoint( x - left, y - top );
-
if( m_tb_window_positions[ window ] != point )
{
m_tb_window_positions[ window ] = point;
@@ -640,13 +663,19 @@ void WindowCtrlUnix::normalizeWindow( quint64 window )
Sync( m_display );
/*
- * Move the window to the last recorded position, seems to be needed for wayland
+ * Force the window to the last known position?
*/
- QPoint pos = m_tb_window_positions[ window ];
- MoveWindow( m_display, window, pos.x(), pos.y() );
- Flush( m_display );
+ if( m_pref->getWindowPositionsCorrection() )
+ {
+ /*
+ * Move the window to the last recorded position
+ */
+ QPoint pos = m_tb_window_positions[ window ];
+ MoveWindow( m_display, window, pos.x(), pos.y() );
+ Flush( m_display );
- emit signalConsole( QString( "Set pos: %1, %2" ).arg( pos.x() ).arg( pos.y() ) );
+ emit signalConsole( QString( "Set pos: %1, %2" ).arg( pos.x() ).arg( pos.y() ) );
+ }
/*
* Let us wait a bit, maybe this helps...
diff --git a/app/SysTray-X/SysTray-X-app/windowctrl-unix.h b/app/SysTray-X/SysTray-X-app/windowctrl-unix.h
index bb24e33..1fbdfd7 100644
--- a/app/SysTray-X/SysTray-X-app/windowctrl-unix.h
+++ b/app/SysTray-X/SysTray-X-app/windowctrl-unix.h
@@ -341,6 +341,13 @@ class WindowCtrlUnix : public QObject
*/
void signalPositions( QList< QPoint > positions );
+ protected:
+
+ /**
+ * @brief m_pref. Pointer to the preferences storage.
+ */
+ Preferences* m_pref;
+
private:
/**
diff --git a/app/SysTray-X/SysTray-X-app/windowctrl-win.h b/app/SysTray-X/SysTray-X-app/windowctrl-win.h
index 1525adc..28450df 100644
--- a/app/SysTray-X/SysTray-X-app/windowctrl-win.h
+++ b/app/SysTray-X/SysTray-X-app/windowctrl-win.h
@@ -272,6 +272,13 @@ class WindowCtrlWin : public QObject
*/
void signalConsole( QString message );
+ protected:
+
+ /**
+ * @brief m_pref. Pointer to the preferences storage.
+ */
+ Preferences* m_pref;
+
private:
/**
diff --git a/app/SysTray-X/SysTray-X-app/windowctrl.h b/app/SysTray-X/SysTray-X-app/windowctrl.h
index b162eb9..60f4993 100644
--- a/app/SysTray-X/SysTray-X-app/windowctrl.h
+++ b/app/SysTray-X/SysTray-X-app/windowctrl.h
@@ -135,11 +135,6 @@ class WindowCtrl : public QObject
private:
- /**
- * @brief m_pref. Pointer to the preferences storage.
- */
- Preferences* m_pref;
-
/**
* @brief m_show_hide_active
*/