Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 1244: KDE/Wayland: Wrong icon in taskbar (default Wayland instead of BiT icon) #1336

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Upcoming Release
* Bugfix: AttributeError in "Diff Options" dialog (#898)
* Bugfix: Settings GUI: "Save password to Keyring" was disabled due to "no appropriate keyring found" (#1321)
* Bugfix: Avoid logging errors while waiting for a target drive to be mounted (#1142, #1143, #1328)
* Bugfix: Wrong systray icon showing in Wayland (#1244)
* Documentation update: correct description of profile<N>.schedule.time in backintime-config manpage (#1270)
* Translation update: Brazilian Portuguese (#1267)
* Translation update: Italian (#1110, #1123)
Expand Down
15 changes: 15 additions & 0 deletions qt/qttools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import sys
import gettext

from PyQt5.QtGui import (QFont, QColor, QKeySequence)
from PyQt5.QtCore import (QDir, Qt, pyqtSlot, pyqtSignal, QModelIndex,
QTranslator, QLocale, QLibraryInfo, QEvent,
Expand All @@ -30,6 +31,7 @@
from calendar import monthrange
from packaging.version import Version


_ = gettext.gettext

def backintimePath(*path):
Expand All @@ -45,6 +47,8 @@ def registerBackintimePath(*path):

registerBackintimePath('common')
import snapshots
import tools
import logger

def fontBold(font):
font.setWeight(QFont.Bold)
Expand Down Expand Up @@ -161,6 +165,17 @@ def createQApplication(app_name = 'Back In Time'):
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
qapp = QApplication(sys.argv)
qapp.setApplicationName(app_name)
try:
if tools.isRoot():
logger.debug("Trying to set App ID for root user")
qapp.setDesktopFileName("backintime-qt-root")
else:
logger.debug("Trying to set App ID for non-privileged user")
qapp.setDesktopFileName("backintime-qt")
except Exception as e:
logger.warning("Could not set App ID (required for Wayland App icon and more)")
logger.warning("Reason: " + repr(e))
qapp.setDesktopFileName("backintime-qt")
if os.geteuid() == 0 and \
qapp.style().objectName().lower() == 'windows' and \
'GTK+' in QStyleFactory.keys():
Expand Down