diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index 77642419..b9bd8118 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -61,40 +61,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void KSMShutdownFeedback::start() { if( KWindowSystem::compositingActive()) { - // HACK do properly + // Announce that the user MAY be logging out (Intended for the compositor) Display* dpy = QX11Info::display(); - char net_wm_cm_name[ 100 ]; - sprintf( net_wm_cm_name, "_NET_WM_CM_S%d", DefaultScreen( dpy )); - Atom net_wm_cm = XInternAtom( dpy, net_wm_cm_name, False ); - Window sel = XGetSelectionOwner( dpy, net_wm_cm ); - Atom hack = XInternAtom( dpy, "_KWIN_LOGOUT_EFFECT", False ); - bool wmsupport = false; - if( sel != None ) { - KXErrorHandler handler; - int cnt; - Atom* props = XListProperties( dpy, sel, &cnt ); - if( !handler.error( false ) && props != NULL && qFind( props, props + cnt, hack ) != props + cnt ) - wmsupport = true; - if( props != NULL ) - XFree( props ); - } - if( wmsupport ) { - // Announce that the user MAY be logging out (Intended for the compositor) - Atom announce = XInternAtom(dpy, "_KDE_LOGGING_OUT", False); - unsigned char dummy = 0; - XChangeProperty(dpy, QX11Info::appRootWindow(), announce, announce, 8, PropModeReplace, - &dummy, 1); - - // Don't show our own effect - return; - } + Atom announce = XInternAtom(dpy, "_KDE_LOGGING_OUT", False); + unsigned char dummy = 0; + XChangeProperty(dpy, QX11Info::appRootWindow(), announce, announce, 8, PropModeReplace, &dummy, 1); } } void KSMShutdownFeedback::stop() { if( KWindowSystem::compositingActive()) { - // We are no longer logging out, announce (Intended for the compositor) + // No longer logging out, announce (Intended for the compositor) Display* dpy = QX11Info::display(); Atom announce = XInternAtom(dpy, "_KDE_LOGGING_OUT", False); XDeleteProperty(QX11Info::display(), QX11Info::appRootWindow(), announce); diff --git a/kwin/effects/logout/logout.cpp b/kwin/effects/logout/logout.cpp index b6f514ad..df42b61d 100644 --- a/kwin/effects/logout/logout.cpp +++ b/kwin/effects/logout/logout.cpp @@ -45,16 +45,6 @@ LogoutEffect::LogoutEffect() logoutAtom = XInternAtom(display(), "_KDE_LOGGING_OUT", False); effects->registerPropertyType(logoutAtom, true); - // Block KSMServer's effect - char net_wm_cm_name[100]; - ::memset(net_wm_cm_name, '\0', sizeof(net_wm_cm_name) * sizeof(char)); - sprintf(net_wm_cm_name, "_NET_WM_CM_S%d", DefaultScreen(display())); - Atom net_wm_cm = XInternAtom(display(), net_wm_cm_name, False); - Window sel = XGetSelectionOwner(display(), net_wm_cm); - Atom hack = XInternAtom(display(), "_KWIN_LOGOUT_EFFECT", False); - XChangeProperty(display(), sel, hack, hack, 8, PropModeReplace, (unsigned char*)&hack, 1); - // the atom is not removed when effect is destroyed, this is temporary anyway - reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); @@ -97,11 +87,12 @@ void LogoutEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Window data.multiplyBrightness((1.0 - progress * 0.3)); } } - if (w == logoutWindow || - ignoredWindows.contains(w)) // HACK: All windows past the first ignored one should not be - // blurred as it affects the stacking order. - // All following windows are on top of the logout window and should not be altered either + if (w == logoutWindow || ignoredWindows.contains(w)) { + // HACK: All windows past the first ignored one should not be blurred as it affects the + // stacking order. All following windows are on top of the logout window and should not + // be altered either logoutWindowPassed = true; + } } effects->paintWindow(w, mask, region, data); }