This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Disable glide and fade animation for xfce4-notifyd

Tags: None
(comma "," separated)
bloch
Registered Member
Posts
11
Karma
0
Hello,
I'm using XFCE with KWin and would like to use the glide and fade animations, but disable them for the XFCE notifications from xfce4-notifyd. Is there a way to set this? How?
Thanks.

Last edited by bloch on Tue Aug 19, 2014 3:12 am, edited 1 time in total.
luebking
Karma
0
Not from a user POV - the XFCE notification could set the _KDE_SLIDE property to slide into the desktop like plasma notifications.

The fade-in effect is a scripted effect (so you could edit this to ignore windows with a certain class - if the notification provides suitable NETWM hints)

Glide hasn't been changed to scripting so far, so you'd have to edit the effects code (and recompile it) - kwin/effects/glide/glide.cpp:228
Code: Select all
bool GlideEffect::isGlideWindow(EffectWindow* w)
{
...
w->windowClass() == "dashboard dashboard" || w->windowClass() == "xfcenote xfcenote")
}


You can fetch the window class (iff(!) the notification sets it) using "xprop" on that window.
bloch
Registered Member
Posts
11
Karma
0
Fade is good enough, a script seems to be easier than having to compile - at least a little easier, I don't understand it yet :-\
Is this a good starting point:? http://rohanprabhu.com/kwin-scripting-tutorial/
Or do you have better hints?
Or is scripting for someone here so easy, he (or she) can just drop the script for disabling fade for such windows?

xprop for XFCE notifications looks good:
Code: Select all
$ xprop
_KDE_NET_WM_ACTIVITIES(STRING) = "00000000-0000-0000-0000-000000000000"
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
WM_STATE(WM_STATE):
      window state: Normal
      icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 4294967295
_NET_WM_STATE(ATOM) = _NET_WM_STATE_ABOVE, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_STICKY, _NET_WM_STATE_SKIP_TASKBAR, _NET_WM_STATE_SKIP_PAGER
WM_HINTS(WM_HINTS):
      Client accepts input or input focus: False
      Initial state is Normal State.
      window id # of group leader: 0x5800001
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 5316235
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 92275232
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NOTIFICATION
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x580021f
WM_CLIENT_LEADER(WINDOW): window id # 0x5800001
_NET_WM_PID(CARDINAL) = 8816
WM_LOCALE_NAME(STRING) = "de_DE.UTF-8"
WM_CLIENT_MACHINE(STRING) = "archie"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
      program specified location: 0, 0
      program specified minimum size: 306 by 105
      program specified maximum size: 306 by 105
      window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "xfce4-notifyd", "Xfce4-notifyd"
WM_ICON_NAME(STRING) = "xfce4-notifyd"
_NET_WM_ICON_NAME(UTF8_STRING) = "xfce4-notifyd"
WM_NAME(STRING) = "xfce4-notifyd"
_NET_WM_NAME(UTF8_STRING) = "xfce4-notifyd"
bloch
Registered Member
Posts
11
Karma
0
OK, I'm one step further. I discovered the script file, it's /usr/share/apps/kwin/effects/kwin4_effect_fade/contents/code/main.js.
There I changed
Code: Select all
function isFadeWindow(w) {
    if (w.deleted && effect.isGrabbed(w, Effect.WindowClosedGrabRole)) {
        return false;
    } else if (!w.deleted && effect.isGrabbed(w, Effect.WindowAddedGrabRole)) {
        return false;
    }
    return w.onCurrentDesktop && !isLoginWindow(w) && !w.desktopWindow && !w.utility && !w.minimized;
}

to
Code: Select all
function isFadeWindow(w) {
    if (w.deleted && effect.isGrabbed(w, Effect.WindowClosedGrabRole)) {
        return false;
    } else if (!w.deleted && effect.isGrabbed(w, Effect.WindowAddedGrabRole)) {
        return false;
    }
    if (w.windowClass == "xfce4-notifyd Xfce4-notifyd") {
        return false;
    }
    return w.onCurrentDesktop && !isLoginWindow(w) && !w.desktopWindow && !w.utility && !w.minimized;
}


saved the file, restarted KWin by "kwin --replace", and tested a notification:
It's still faded.
Does anyone know what's wrong?


PS:
Of course I also tried if (w.windowClass == "xfce4-notifyd") ... and if (w.windowClass == "Xfce4-notifyd").
luebking
Karma
0
try with both elements lowercased (transition happens for -now rather legacy- compatibility w/ qt3 clients)
bloch
Registered Member
Posts
11
Karma
0
luebking wrote:try with both elements lowercased (transition happens for -now rather legacy- compatibility w/ qt3 clients)


Yes that works! :-D
Thank you very much!

For the record or it is helpful for someone else: the whole file is now:
Code: Select all
/********************************************************************
 KWin - the KDE window manager
 This file is part of the KDE project.

 Copyright (C) 2007 Philip Falkner <philip.falkner@gmail.com>
 Copyright (C) 2012 Martin Gräßlin <mgraesslin@kde.org>

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/>.
*********************************************************************/
function isFadeWindow(w) {
    if (w.deleted && effect.isGrabbed(w, Effect.WindowClosedGrabRole)) {
        return false;
    } else if (!w.deleted && effect.isGrabbed(w, Effect.WindowAddedGrabRole)) {
        return false;
    }
    if (w.windowClass == "xfce4-notifyd xfce4-notifyd") {
        return false;
    }
    return w.onCurrentDesktop && !isLoginWindow(w) && !w.desktopWindow && !w.utility && !w.minimized;
}

function isLoginWindow(w) {
    return w.windowClass == "ksplashx ksplashx" || w.windowClass == "ksplashsimple ksplashsimple" || w.windowClass == "qt-subapplication ksplashqml";
}

var fadeInTime, fadeOutTime, fadeWindows;
function loadConfig() {
    fadeInTime = animationTime(effect.readConfig("FadeInTime", 150));
    fadeOutTime = animationTime(effect.readConfig("FadeOutTime", 150)) * 4;
    fadeWindows = effect.readConfig("FadeWindows", true);
}
loadConfig();
effect.configChanged.connect(function() {
    loadConfig();
});
effects.windowAdded.connect(function(w) {
    if (fadeWindows && isFadeWindow(w)) {
        effect.animate(w, Effect.Opacity, fadeInTime, 1.0, 0.0);
    }
});
effects.windowClosed.connect(function(w) {
    if (fadeWindows && isFadeWindow(w)) {
        animate({
            window: w,
            duration: fadeOutTime,
            animations: [{
                type: Effect.Opacity,
                curve: QEasingCurve.OutQuart,
                to: 0.0
            }]
        });
    }
});
bloch
Registered Member
Posts
11
Karma
0
For the record: With Plasma5, that doesn't work anymore.
What works instead, is:
Make a windowrule for Xfce4-notifyd and force windowtyp menubar. That doesn't make complete sense, but works anyway. No fade animation for xfce4-notifyd that way.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft