Skip to content

Commit

Permalink
Merge pull request #3 from LizardByte/fix-legacy-appindicator
Browse files Browse the repository at this point in the history
Fix for legacy appindicator
  • Loading branch information
ReenigneArcher authored Sep 18, 2023
2 parents 2921d96 + f42c655 commit 6e3d690
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ else()
target_compile_options(tray PRIVATE ${APPINDICATOR_CFLAGS})
target_link_directories(tray PRIVATE ${APPINDICATOR_LIBRARY_DIRS})
target_compile_definitions(tray PRIVATE TRAY_APPINDICATOR=1)
if(APPINDICATOR_AYATANA)
target_compile_definitions(tray PRIVATE TRAY_AYATANA_APPINDICATOR=1)
endif()
if(APPINDICATOR_LEGACY)
target_compile_definitions(tray PRIVATE TRAY_LEGACY_APPINDICATOR=1)
endif()
target_compile_definitions(tray PRIVATE TRAY_LIBNOTIFY=1)
target_link_libraries(tray PRIVATE ${APPINDICATOR_LIBRARIES} ${LIBNOTIFY_LIBRARIES})
endif()
Expand Down
7 changes: 6 additions & 1 deletion cmake/FindAPPINDICATOR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ include(FindPackageHandleStandardArgs)

PKG_CHECK_MODULES(APPINDICATOR ayatana-appindicator3-0.1)
IF( APPINDICATOR_FOUND )
SET(HAVE_AYATANAAPPINDICATOR 1)
SET(APPINDICATOR_AYATANA 1)
ELSE()
PKG_CHECK_MODULES(APPINDICATOR appindicator3-0.1)
IF( APPINDICATOR_FOUND )
SET(APPINDICATOR_LEGACY 1)
ENDIF()
ENDIF()

mark_as_advanced(APPINDICATOR_INCLUDE_DIR APPINDICATOR_LIBRARY)
9 changes: 7 additions & 2 deletions tray_linux.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#include "tray.h"
#include <string.h>
#include <stddef.h>
#ifdef TRAY_AYATANA_APPINDICATOR
#include <libayatana-appindicator/app-indicator.h>
#elif TRAY_LEGACY_APPINDICATOR
#include <appindicator/app-indicator.h>
#endif

#include <libnotify/notify.h>
#include <stddef.h>
#include <string.h>
#define TRAY_APPINDICATOR_ID "tray-id"

static AppIndicator *indicator = NULL;
Expand Down

0 comments on commit 6e3d690

Please sign in to comment.