Bug 191114

Summary: wrong window-state-event produced when in minimized + hidden state
Product: [Plasma] kwin Reporter: Damanjit Singh <dsingh>
Component: compatibilityAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: finex, kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: sample gtk app
Source code for the attached sample app.

Description Damanjit Singh 2009-04-30 08:27:00 UTC
Version:            (using KDE 4.1.3)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    SuSE RPMs

Follow these steps on any window (in KDE env with desktop effects ON) - 
1. Minimize the window
2. Hide the window (gtk_widget_hide)
3. Show the window (gtk_widget_show)

Observe the window-state-events produced.

For the step 3 we get 3 state change events (when only one was expected)
we get - 
state change from 3 to 2              // This is correct and expected
then, state change from 2 to 0        // This was not expected (wrong)
and gain, state change from 0 to 2    // This was not expected (wrong)
Comment 1 Damanjit Singh 2009-04-30 08:33:20 UTC
Created attachment 33233 [details]
sample gtk app

Sample gtk app to demostrate the bug. 
1. Run the app - (will show two windows - " Hello" and "World")
2. Minimize the "World" window
3. click hide button on the "Hello" window
4. click show button on the "World" window
5. Observe the state change events Produced (on console)
Comment 2 Damanjit Singh 2009-04-30 08:34:38 UTC
Created attachment 33234 [details]
Source code for the attached sample app.

Source code for the attached sample app.
Comment 3 FiNeX 2009-04-30 14:10:15 UTC
Could this report be moved to kdelibs or kwin product?
Comment 4 Thomas Lübking 2012-04-11 22:12:13 UTC
Sorry for the late reply.

No idea why this is set "HI" but it's a tricky one.

The reason is that setupCompositing() in manage() is called before the desktop (and activity) is assigned.
As a result updateVisibility() will call internalKeep().

@Damanjit
Why is this an issue?
Comment 5 Justin Zobel 2021-03-10 00:12:43 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.