1 Star 0 Fork 11

douyan/ukui-screensaver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0008-Screen-saver-add-x11-attribute.patch 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
From 3ff7cce8755475f9a458cabf9bfacafb2f587225 Mon Sep 17 00:00:00 2001
From: tanyulong <tanyulong@kylinos.cn>
Date: Tue, 2 Nov 2021 14:52:58 +0800
Subject: [PATCH] Screen saver add x11 attribute
---
screensaver/screensaver.cpp | 1 +
src/screensaverwidget.cpp | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/screensaver/screensaver.cpp b/screensaver/screensaver.cpp
index f722c8f..1739afd 100755
--- a/screensaver/screensaver.cpp
+++ b/screensaver/screensaver.cpp
@@ -57,6 +57,7 @@ Screensaver::Screensaver(QWidget *parent):
m_timer(nullptr)
{
installEventFilter(this);
+ setWindowFlags(Qt::X11BypassWindowManagerHint);
setUpdateCenterWidget();
initUI();
m_background = new MBackground();
diff --git a/src/screensaverwidget.cpp b/src/screensaverwidget.cpp
index 8f9efd3..d691786 100755
--- a/src/screensaverwidget.cpp
+++ b/src/screensaverwidget.cpp
@@ -37,10 +37,15 @@ ScreenSaverWidget::ScreenSaverWidget(ScreenSaver *screensaver, QWidget *parent)
setFocus();
this->installEventFilter(this);
- QPalette plt;
- plt.setBrush(QPalette::Window, Qt::black);
- setPalette(plt);
+ //QPalette plt;
+ //plt.setBrush(QPalette::Window, Qt::black);
+ //setPalette(plt);
+ QPalette pal(palette());
+ pal.setColor(QPalette::Background, Qt::black); //设置背景黑色
+
setAutoFillBackground(true);
+ setPalette(pal);
+
switch(screensaver->mode) {
case SAVER_RANDOM:
case SAVER_SINGLE:
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dou33/ukui-screensaver.git
git@gitee.com:dou33/ukui-screensaver.git
dou33
ukui-screensaver
ukui-screensaver
master

搜索帮助