Bug 57367 - knotes: window always in front behaves wrong after closing
Summary: knotes: window always in front behaves wrong after closing
Status: RESOLVED FIXED
Alias: None
Product: knotes
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Brade
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-17 11:03 UTC by Andreas Hochsteger
Modified: 2003-04-25 14:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Hochsteger 2003-04-17 11:03:48 UTC
Version:           2.3 (using KDE 3.1.1)
Installed from:    SuSE
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.20-4GB-athlon

If you set a knote window so that it's always in front of other windows, close and open it afterwards, it doesn't behave so anymore, although the window menu displays it as 'always in front'.
In fact, if you remove 'always in front' from the window menu now, it suddenly stays in front.
Comment 1 Michael Brade 2003-04-25 14:08:23 UTC
Subject: kdepim/knotes

CVS commit by brade: 

Awful and temporary hack to fix #57367:
Always On Top property lost when hide->show a note. IMHO, this is a bug
in KWin. Lubos, shouldn't NET::StaysOnTop be saved for hidden windows as well?

CCMAIL: l.lunak@kde.org, 57367-done@bugs.kde.org


  M +6 -1      knote.cpp   1.82
  M +2 -0      knote.h   1.26
  M +5 -1      knotesapp.cpp   1.53


--- kdepim/knotes/knote.cpp  #1.81:1.82
@@ -228,5 +228,10 @@ void KNote::saveConfig() const
     config.setGroup( "WindowDisplay" );
     config.writeEntry( "desktop", wm_client.desktop() );
+
+    if ( isHidden() && m_alwaysOnTop->isChecked() )
+        config.writeEntry( "state", wm_client.state() | NET::StaysOnTop );
+    else
     config.writeEntry( "state", wm_client.state() );
+
     // TODO: move to group Display
     config.writeEntry( "position", pos() );

--- kdepim/knotes/knote.h  #1.25:1.26
@@ -115,5 +115,7 @@ private:
     QString        m_configFile;
 
+public:
     KToggleAction *m_alwaysOnTop;
+private:
     KListAction   *m_toDesktop;
 

--- kdepim/knotes/knotesapp.cpp  #1.52:1.53
@@ -445,8 +445,12 @@ void KNotesApp::showNote( KNote* note ) 
     else
     {
+        WId id = note->winId();
+
         // if not, show note on the current desktop
         note->show();
         note->toDesktop( KWin::currentDesktop() );
-        KWin::setActiveWindow( note->winId() );
+        if ( note->m_alwaysOnTop->isChecked() )
+            KWin::setState( id, KWin::info( id ).state | NET::StaysOnTop );
+        KWin::setActiveWindow( id );
         note->setFocus();
     }