Re: [PATCH] disable the fade effect from the slidingpopups effect

2009-09-04 Thread Martin Gräßlin
Am Freitag 04 September 2009 02:34:13 schrieb Marco Martin:
 On 9/3/09, Lucas Murray lmur...@undefinedfire.com wrote:
  On Thu, Sep 3, 2009 at 7:36 PM, Marco Martinnotm...@gmail.com wrote:
  this patch adds a proxy to the fade effect that permits to set ignored
  windows, all the windows where slidingpopups is applied add themseves
  to this list
 
  - Does not meet coding style (Check whitespace between parentheses and
  end of lines as well as brace locations)
  - Example comments have not been removed (E.g. // Example proxy code,
  TODO: Use or remove)
  - Typos in other comments
  - kDebug() should be in zone 1212 (Although I think this is no longer
  required in trunk it should still be added for consistency)
  - Those debug comments probably shouldn't even be required
  - FadeEffect::proxy() should not be const'ed on either side due to
  recent proxy API changes at your request
  - Code does not take into account when a window initially slides out
  yet has been configured to not slide back in on close (Currently it
  prevents the window from being faded as windows are only ever added to
  the list, never removed)
  - Memory leak: Windows are not removed from FadeEffect::ignoredWindows
  when they are deleted
 
 this version should address those points
It still doesn't use the kwin coding style in fade.cpp :-P
and kDebug is not in 1212 - I agree with Lucas that it's better for the 
consistency
 
 Cheers,
 Marco Martin
 
  --
 
  Lucas Murray :: http://www.undefinedfire.com
  GPG Fingerprint: 0B88 499E 3F5B 1405 D952  258A AD90 B4F5 90B6 3534
  ___
  Plasma-devel mailing list
  Plasma-devel@kde.org
  https://mail.kde.org/mailman/listinfo/plasma-devel
 


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: [PATCH] disable the fade effect from the slidingpopups effect

2009-09-04 Thread Marco Martin
On 9/4/09, Martin Gräßlin k...@martin-graesslin.com wrote:
 Am Freitag 04 September 2009 02:34:13 schrieb Marco Martin:
 On 9/3/09, Lucas Murray lmur...@undefinedfire.com wrote:
  On Thu, Sep 3, 2009 at 7:36 PM, Marco Martinnotm...@gmail.com wrote:
  this patch adds a proxy to the fade effect that permits to set ignored
  windows, all the windows where slidingpopups is applied add themseves
  to this list
 
  - Does not meet coding style (Check whitespace between parentheses and
  end of lines as well as brace locations)
  - Example comments have not been removed (E.g. // Example proxy code,
  TODO: Use or remove)
  - Typos in other comments
  - kDebug() should be in zone 1212 (Although I think this is no longer
  required in trunk it should still be added for consistency)
  - Those debug comments probably shouldn't even be required
  - FadeEffect::proxy() should not be const'ed on either side due to
  recent proxy API changes at your request
  - Code does not take into account when a window initially slides out
  yet has been configured to not slide back in on close (Currently it
  prevents the window from being faded as windows are only ever added to
  the list, never removed)
  - Memory leak: Windows are not removed from FadeEffect::ignoredWindows
  when they are deleted

 this version should address those points
 It still doesn't use the kwin coding style in fade.cpp :-P
 and kDebug is not in 1212 - I agree with Lucas that it's better for the
 consistency

uh, sorry:)
hope to not still have forgotten something in this one


Cheers,
Marco Martin

  --
 
  Lucas Murray :: http://www.undefinedfire.com
  GPG Fingerprint: 0B88 499E 3F5B 1405 D952  258A AD90 B4F5 90B6 3534
  ___
  Plasma-devel mailing list
  Plasma-devel@kde.org
  https://mail.kde.org/mailman/listinfo/plasma-devel


Index: fade/fade.cpp
===
--- fade/fade.cpp	(revision 1019580)
+++ fade/fade.cpp	(working copy)
@@ -28,10 +28,16 @@
 KWIN_EFFECT( fade, FadeEffect )
 
 FadeEffect::FadeEffect()
+: m_proxy( this )
 {
 reconfigure( ReconfigureAll );
 }
 
+void* FadeEffect::proxy()
+{
+return m_proxy;
+}
+
 void FadeEffect::reconfigure( ReconfigureFlags )
 {
 KConfigGroup conf = effects-effectConfig( Fade );
@@ -193,12 +199,26 @@
 void FadeEffect::windowDeleted( EffectWindow* w )
 {
 windows.remove( w );
+ignoredWindows.remove( w );
 }
 
+void FadeEffect::setWindowIgnored( EffectWindow* w, bool ignore )
+{
+if( ignore )
+{
+ignoredWindows.insert(w);
+}
+else
+{
+ignoredWindows.remove(w);
+}
+}
+
 bool FadeEffect::isFadeWindow( EffectWindow* w )
 {
 if( w-windowClass() == ksplashx ksplashx
-|| w-windowClass() == ksplashsimple ksplashsimple )
+|| w-windowClass() == ksplashsimple ksplashsimple 
+|| ignoredWindows.contains(w))
 { // see login effect
 return false;
 }
Index: fade/fade_proxy.cpp
===
--- fade/fade_proxy.cpp	(revision 0)
+++ fade/fade_proxy.cpp	(revision 0)
@@ -0,0 +1,40 @@
+/
+ KWin - the KDE window manager
+ This file is part of the KDE project.
+
+Copyright (C) 2009 Marco Martin notm...@gmail.com
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see http://www.gnu.org/licenses/.
+*/
+
+#include fade_proxy.h
+#include fade.h
+
+namespace KWin
+{
+
+FadeEffectProxy::FadeEffectProxy( FadeEffect* effect )
+: m_effect( effect )
+{
+}
+
+FadeEffectProxy::~FadeEffectProxy()
+{
+}
+
+void FadeEffectProxy::setWindowIgnored( EffectWindow *w, bool ignore ) const
+{
+m_effect-setWindowIgnored( w, ignore );
+}
+} // namespace
Index: fade/fade.h
===
--- fade/fade.h	(revision 1019580)
+++ fade/fade.h	(working copy)
@@ -21,6 +21,8 @@
 #ifndef KWIN_FADE_H
 #define KWIN_FADE_H
 
+#include fade_proxy.h
+
 #include kwineffects.h
 
 namespace KWin
@@ -41,14 +43,19 @@
 virtual void windowAdded( EffectWindow* c );
 virtual void windowClosed( EffectWindow* c );
 virtual void windowDeleted( EffectWindow* c );
+virtual void* proxy();
+
 

Re: [PATCH] disable the fade effect from the slidingpopups effect

2009-09-03 Thread Lucas Murray
On Thu, Sep 3, 2009 at 7:36 PM, Marco Martinnotm...@gmail.com wrote:
 this patch adds a proxy to the fade effect that permits to set ignored
 windows, all the windows where slidingpopups is applied add themseves
 to this list

- Does not meet coding style (Check whitespace between parentheses and
end of lines as well as brace locations)
- Example comments have not been removed (E.g. // Example proxy code,
TODO: Use or remove)
- Typos in other comments
- kDebug() should be in zone 1212 (Although I think this is no longer
required in trunk it should still be added for consistency)
- Those debug comments probably shouldn't even be required
- FadeEffect::proxy() should not be const'ed on either side due to
recent proxy API changes at your request
- Code does not take into account when a window initially slides out
yet has been configured to not slide back in on close (Currently it
prevents the window from being faded as windows are only ever added to
the list, never removed)
- Memory leak: Windows are not removed from FadeEffect::ignoredWindows
when they are deleted

-- 

Lucas Murray :: http://www.undefinedfire.com
GPG Fingerprint: 0B88 499E 3F5B 1405 D952  258A AD90 B4F5 90B6 3534
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel