From cce6297ccebb7de8ecbf67b8f4e3ac2e23cb39e3 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sun, 10 Jan 2021 12:10:00 +0100 Subject: [PATCH] Allow only minimize events --- app/SysTray-X/SysTray-X-app/windowctrl.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/SysTray-X/SysTray-X-app/windowctrl.cpp b/app/SysTray-X/SysTray-X-app/windowctrl.cpp index 39578c8..30ab747 100644 --- a/app/SysTray-X/SysTray-X-app/windowctrl.cpp +++ b/app/SysTray-X/SysTray-X-app/windowctrl.cpp @@ -217,16 +217,19 @@ void WindowCtrl::slotWindowState( Preferences::WindowState state ) } else { - /* - * Compare the x11 states and the internal states - */ - for( int i = 0 ; i < win_ids.length() ; ++i ) + if( state == Preferences::STATE_MINIMIZED ) { - Preferences::WindowState current_state = getWindowStateX11( i ); - - if( ( current_state == Preferences::STATE_MINIMIZED || current_state == Preferences::STATE_DOCKED ) && current_state != getWindowState( win_ids.at( i ) ) ) + /* + * Compare the x11 states and the internal states + */ + for( int i = 0 ; i < win_ids.length() ; ++i ) { - minimizeWindow( win_ids.at( i ) ); + Preferences::WindowState current_state = getWindowStateX11( i ); + + if( ( current_state == Preferences::STATE_MINIMIZED || current_state == Preferences::STATE_DOCKED ) && current_state != getWindowState( win_ids.at( i ) ) ) + { + minimizeWindow( win_ids.at( i ) ); + } } } }