Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
df32a11
Import adapted QtTrayMenu class from upstream
Kishi85 May 7, 2026
a14dd42
Integrate upstream QtTrayMenu.h/cpp into tray_linux.cpp
Kishi85 May 7, 2026
ff0a4fe
doc: Add doxygen comments for public functions of QtTrayMenu
Kishi85 May 10, 2026
8359dd0
fix: Add default initialized values and change running state tracking
Kishi85 May 10, 2026
e36c5fd
Add support for spectacle screenshots on KDE
Kishi85 May 11, 2026
f319ee1
Revert example to non-notification variant
Kishi85 May 10, 2026
d9d6268
fix: Segfaults from unit tests
Kishi85 May 10, 2026
d29f2fb
WIP - process events during exit
Kishi85 May 12, 2026
ca2c5e9
Update test_tray.cpp
ReenigneArcher May 12, 2026
4ba98bd
Provide default argv, hide menu, use popup
ReenigneArcher May 12, 2026
25ab2ad
QApplication::quit() only for apps that we created.
Kishi85 May 12, 2026
65f5bba
Cleanup QtTrayMenu constructor
Kishi85 May 12, 2026
d69ddb6
Add option to fire notification using QSystemTray::showMessage on ini…
Kishi85 May 12, 2026
9e71ed2
(Re-)Implement tray notifications using libnotify with fallback to ba…
Kishi85 May 12, 2026
867accc
Refactor tray_linux.cpp notifications and add separate namespace for …
Kishi85 May 16, 2026
8eefa9f
fix: Properly cleanup notificationCurrent and notificationCurrentCall…
Kishi85 May 16, 2026
12163a4
refactor - Use acknowledge_notification to also clear previous notifi…
Kishi85 May 16, 2026
3aa88ca
fix: Allow using themed icons for tray icon
Kishi85 May 16, 2026
77873ce
fix: Always use absolute paths for filesystem-based notification icons
Kishi85 May 16, 2026
97b05d2
fix: Add missing/fix docstrings and unify variable style for namespac…
Kishi85 May 17, 2026
21e6e3e
fix: Remove Qt::DBus dependency
Kishi85 May 17, 2026
1aea7f6
fix: Fix potential issues with QtTrayMenu
Kishi85 May 17, 2026
c8036a0
fix: Re-init notify upon setting app_name
Kishi85 May 17, 2026
b19d1b3
fix: Process UI modifications using Qt event system
Kishi85 May 17, 2026
cf1f909
fix: Improve error handling on tray_init
Kishi85 May 18, 2026
6f718bc
tests: Increase delay for screenshot capture to 2000ms
Kishi85 May 19, 2026
c7f8378
fix: Only fail tray init on libnotify failure if Qt does not support …
Kishi85 May 19, 2026
b2479e5
fix: Requested changes from review
Kishi85 May 19, 2026
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
"imagemagick"
"ninja-build"
"xvfb"
"libnotify-dev"
Comment thread
Kishi85 marked this conversation as resolved.
Outdated
)

if [[ "${QT_VERSION}" == "5" ]]; then
Expand Down
19 changes: 14 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,23 @@ else()
find_library(COCOA Cocoa REQUIRED)
list(APPEND TRAY_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/tray_darwin.m")
else()
find_package(Qt6 COMPONENTS Widgets DBus Svg)
find_package(LibNotify REQUIRED)
find_package(Qt6 COMPONENTS Widgets Svg)
if(Qt6_FOUND)
set(TRAY_QT_VERSION 6)
else()
find_package(Qt5 REQUIRED COMPONENTS Widgets DBus Svg)
find_package(Qt5 REQUIRED COMPONENTS Widgets Svg)
set(TRAY_QT_VERSION 5)
endif()
set(TRAY_QT_VERSION # cmake-lint: disable=C0103
"${TRAY_QT_VERSION}"
CACHE INTERNAL "Qt major version selected by tray"
)
set(CMAKE_AUTOMOC ON)
list(APPEND TRAY_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/tray_linux.cpp")
list(APPEND TRAY_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/src/tray_linux.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/QtTrayMenu.cpp"
)
endif()
endif()
endif()
Expand All @@ -110,10 +114,15 @@ else()
list(APPEND TRAY_EXTERNAL_LIBRARIES ${COCOA})
else()
if(TRAY_QT_VERSION EQUAL 6)
list(APPEND TRAY_EXTERNAL_LIBRARIES Qt6::Widgets Qt6::DBus Qt6::Svg)
list(APPEND TRAY_EXTERNAL_LIBRARIES Qt6::Widgets Qt6::Svg)
else()
list(APPEND TRAY_EXTERNAL_LIBRARIES Qt5::Widgets Qt5::DBus Qt5::Svg)
list(APPEND TRAY_EXTERNAL_LIBRARIES Qt5::Widgets Qt5::Svg)
endif()
list(APPEND TRAY_LIBNOTIFY=1)
list(APPEND TRAY_EXTERNAL_LIBRARIES ${LIBNOTIFY_LIBRARIES})

include_directories(SYSTEM ${LIBNOTIFY_INCLUDE_DIRS})
link_directories(${LIBNOTIFY_LIBRARY_DIRS})
endif()
endif()
endif()
Expand Down
55 changes: 55 additions & 0 deletions cmake/FindLibNotify.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# - Try to find LibNotify
# This module defines the following variables:
#
# LIBNOTIFY_FOUND - LibNotify was found
# LIBNOTIFY_INCLUDE_DIRS - the LibNotify include directories
# LIBNOTIFY_LIBRARIES - link these to use LibNotify
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
# Copyright (C) 2014 Collabora Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

find_package(PkgConfig)
pkg_check_modules(LIBNOTIFY QUIET libnotify)

find_path(LIBNOTIFY_INCLUDE_DIRS
NAMES notify.h
HINTS ${LIBNOTIFY_INCLUDEDIR}
${LIBNOTIFY_INCLUDE_DIRS}
PATH_SUFFIXES libnotify
)

find_library(LIBNOTIFY_LIBRARIES
NAMES notify
HINTS ${LIBNOTIFY_LIBDIR}
${LIBNOTIFY_LIBRARY_DIRS}
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibNotify REQUIRED_VARS LIBNOTIFY_INCLUDE_DIRS LIBNOTIFY_LIBRARIES
VERSION_VAR LIBNOTIFY_VERSION)

mark_as_advanced(
LIBNOTIFY_INCLUDE_DIRS
LIBNOTIFY_LIBRARIES
)
Loading
Loading