mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-05-07 01:56:22 +02:00
Internal window state storage
This commit is contained in:
@@ -33,6 +33,7 @@ WindowCtrlUnix::WindowCtrlUnix( QObject *parent ) : QObject( parent )
|
||||
m_tb_windows = QList< quint64 >();
|
||||
m_tb_window_positions = QList< QPoint >();
|
||||
m_tb_window_states = QList< Preferences::WindowState >();
|
||||
m_tb_window_states_internal = QMap< quint64, Preferences::WindowState >();
|
||||
m_tb_window_hints = QMap< quint64, SizeHints >();
|
||||
|
||||
/*
|
||||
@@ -375,6 +376,15 @@ const QList< Preferences::WindowState >& WindowCtrlUnix::getWindowStates() co
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the state of a TB window.
|
||||
*/
|
||||
Preferences::WindowState& WindowCtrlUnix::getWindowStateInternal( quint64 window )
|
||||
{
|
||||
return m_tb_window_states_internal[ window ];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display window atoms
|
||||
*/
|
||||
@@ -638,6 +648,18 @@ void WindowCtrlUnix::minimizeWindow( quint64 window )
|
||||
* Remove from taskbar and task switchers
|
||||
*/
|
||||
WithdrawWindow( m_display, window );
|
||||
|
||||
/*
|
||||
* Store the window state
|
||||
*/
|
||||
m_tb_window_states_internal[ window ] = Preferences::STATE_DOCKED;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Store the window state
|
||||
*/
|
||||
m_tb_window_states_internal[ window ] = Preferences::STATE_MINIMIZED;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -716,6 +738,11 @@ void WindowCtrlUnix::normalizeWindow( quint64 window )
|
||||
Flush( m_display );
|
||||
}
|
||||
|
||||
/*
|
||||
* Store the window state
|
||||
*/
|
||||
m_tb_window_states_internal[ window ] = Preferences::STATE_NORMAL;
|
||||
|
||||
/*
|
||||
* Raise the window to the top
|
||||
*/
|
||||
|
||||
@@ -187,6 +187,15 @@ class WindowCtrlUnix : public QObject
|
||||
*/
|
||||
const QList< Preferences::WindowState >& getWindowStates() const;
|
||||
|
||||
/**
|
||||
* @brief getWindowStateInternal
|
||||
*
|
||||
* @param window
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Preferences::WindowState& getWindowStateInternal( quint64 window );
|
||||
|
||||
/**
|
||||
* @brief displayWindowElements. Display window elements (atoms).
|
||||
*
|
||||
@@ -293,6 +302,11 @@ class WindowCtrlUnix : public QObject
|
||||
*/
|
||||
QList< Preferences::WindowState > m_tb_window_states;
|
||||
|
||||
/**
|
||||
* @brief m_tb_window_states_internal. The Thunderbird window states (internal).
|
||||
*/
|
||||
QMap< quint64, Preferences::WindowState > m_tb_window_states_internal;
|
||||
|
||||
/**
|
||||
* @brief m_tb_window_hints. The Thunderbird window hints.
|
||||
*/
|
||||
|
||||
@@ -297,6 +297,10 @@ void WindowCtrl::slotShowHide()
|
||||
emit signalConsole( QString( "Window state: %1, %2" )
|
||||
.arg( win_ids.at( i ) )
|
||||
.arg( Preferences::WindowStateString.at( win_states.at( i ) ) ) );
|
||||
|
||||
emit signalConsole( QString( "Window state: %1, %2" )
|
||||
.arg( win_ids.at( i ) )
|
||||
.arg( Preferences::WindowStateString.at( getWindowStateInternal( win_ids.at( i ) ) ) ) );
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
@@ -305,7 +309,9 @@ void WindowCtrl::slotShowHide()
|
||||
|
||||
#endif
|
||||
|
||||
if( win_states.at( i ) == Preferences::STATE_MINIMIZED || win_states.at( i ) == Preferences::STATE_DOCKED )
|
||||
// if( win_states.at( i ) == Preferences::STATE_MINIMIZED || win_states.at( i ) == Preferences::STATE_DOCKED )
|
||||
|
||||
if( getWindowStateInternal( win_ids.at( i ) ) == Preferences::STATE_MINIMIZED || getWindowStateInternal( win_ids.at( i ) ) == Preferences::STATE_DOCKED )
|
||||
{
|
||||
normalizeWindow( win_ids.at( i ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user