dependon / fantascene-dynamic-wallpaper

Managed animated wallpaper based on X11 under Linux(Dynamic Wallpapers for Linux)
GNU General Public License v3.0
200 stars 21 forks source link

返回桌面 (win+D) 图标隐藏 临时解决方案 #4

Open jiangzc opened 3 years ago

jiangzc commented 3 years ago

当动态壁纸窗口激活时,激活桌面图标的窗口

重写动态壁纸窗口的event成员函数,加入下面的代码:

    if (event->type() == QEvent::WindowActivate)
    {
        qDebug() << "Video WindowActivate";
        QTimer::singleShot(100, this, [](){
            system("xdotool search --class dde-desktop windowactivate");
            qDebug() << "Desktop WindowActivate";
        });
    }
   return  QWidget::event(event)  
dependon commented 3 years ago

我试一下

jiangzc commented 3 years ago

我试了,效果可以。副作用是预览桌面的功能变为返回桌面,影响在可接受范围内。

jiangzc commented 3 years ago
bool Wallpaper::event(QEvent *event)
{
    if (event->type() == QEvent::WindowActivate)
    {
        qDebug() << "Video WindowActivate";
        QTimer::singleShot(100, this, [](){
            system("xdotool search --class dde-desktop windowactivate");
            qDebug() << "Desktop WindowActivate";
        });
    }
   return  QWidget::event(event);
}
jiangzc commented 3 years ago

要安装 xdotool ,这应该是系统自带的吧

dependon commented 3 years ago

双屏下只显示一面的桌面,并且再次的话会出现左右切换

dependon commented 3 years ago

不过还是可以接受

dependon commented 3 years ago

双屏需要调用两次system("xdotool search --class dde-desktop windowactivate");

dependon commented 3 years ago

我试了,效果可以。副作用是预览桌面的功能变为返回桌面,影响在可接受范围内。

在0.1.7的版本,你可以试试,似乎很完美的解决了这个问题,就是desktop也是桌面,动态壁纸也是桌面,但是动态壁纸每次动作的时候激活一下desktop,desktop通过一个dbus接口让其关闭壁纸,然后x11找到desktop窗口,设置透明度0.99