From 3dda8a50100c1a2eaa9e7839b3dc9f90f1a09297 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sat, 13 Jul 2024 07:26:06 +0200 Subject: [PATCH] hotkey: Remove glib header dependency --- src/hotkey/Makefile | 4 ++-- src/hotkey/grab.cc | 4 +--- src/hotkey/grab.h | 4 +--- src/hotkey/meson.build | 2 +- src/hotkey/plugin.cc | 2 +- src/hotkey/plugin.h | 4 +--- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/hotkey/Makefile b/src/hotkey/Makefile index 3765d51bd7..40017de53f 100644 --- a/src/hotkey/Makefile +++ b/src/hotkey/Makefile @@ -9,5 +9,5 @@ plugindir := ${plugindir}/${GENERAL_PLUGIN_DIR} LD = ${CXX} CFLAGS += ${PLUGIN_CFLAGS} -CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} ${GLIB_CFLAGS} -I../.. -I.. -LIBS += ${GLIB_LIBS} ${GTK_LIBS} -lX11 -laudgui +CPPFLAGS += ${PLUGIN_CPPFLAGS} ${GTK_CFLAGS} -I../.. -I.. +LIBS += ${GTK_LIBS} -lX11 -laudgui diff --git a/src/hotkey/grab.cc b/src/hotkey/grab.cc index febb96b34a..51bdb51b50 100644 --- a/src/hotkey/grab.cc +++ b/src/hotkey/grab.cc @@ -396,12 +396,10 @@ static GdkFilterReturn gdk_filter(GdkXEvent * xevent, GdkEvent * event, return GDK_FILTER_CONTINUE; } -gboolean setup_filter() +void setup_filter() { gdk_window_add_filter(gdk_screen_get_root_window(gdk_screen_get_default()), gdk_filter, nullptr); - - return true; } void release_filter() diff --git a/src/hotkey/grab.h b/src/hotkey/grab.h index 47935dbbd3..33ff5449d1 100644 --- a/src/hotkey/grab.h +++ b/src/hotkey/grab.h @@ -1,11 +1,9 @@ #ifndef _GRAB_H_INCLUDED_ #define _GRAB_H_INCLUDED_ -#include - void grab_keys(); void ungrab_keys(); -gboolean setup_filter(); +void setup_filter(); void release_filter(); #endif diff --git a/src/hotkey/meson.build b/src/hotkey/meson.build index 1481112501..ba6eaf5d4d 100644 --- a/src/hotkey/meson.build +++ b/src/hotkey/meson.build @@ -16,7 +16,7 @@ hotkey_sources = [ if have_hotkey shared_module('hotkey', hotkey_sources, - dependencies: [audacious_dep, audgui_dep, gtk_dep, glib_dep, gdk_x11_dep, x11_dep], + dependencies: [audacious_dep, audgui_dep, gtk_dep, gdk_x11_dep, x11_dep], name_prefix: '', install: true, install_dir: general_plugin_dir diff --git a/src/hotkey/plugin.cc b/src/hotkey/plugin.cc index b8ccb3871f..f3e3e5fa74 100644 --- a/src/hotkey/plugin.cc +++ b/src/hotkey/plugin.cc @@ -111,7 +111,7 @@ bool GlobalHotkeys::init() } /* handle keys */ -gboolean handle_keyevent(EVENT event) +bool handle_keyevent(EVENT event) { int current_volume, old_volume; static int volume_static = 0; diff --git a/src/hotkey/plugin.h b/src/hotkey/plugin.h index d7dbbfd608..24b06dadca 100644 --- a/src/hotkey/plugin.h +++ b/src/hotkey/plugin.h @@ -1,8 +1,6 @@ #ifndef _PLUGIN_H_INCLUDED_ #define _PLUGIN_H_INCLUDED_ -#include - #define TYPE_KEY 0 #define TYPE_MOUSE 1 @@ -49,6 +47,6 @@ typedef struct void load_config(); void save_config(); PluginConfig * get_config(); -gboolean handle_keyevent(EVENT event); +bool handle_keyevent(EVENT event); #endif