Skip to content

Commit

Permalink
hotkey: Remove glib header dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Jul 13, 2024
1 parent 5d68107 commit 3dda8a5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/hotkey/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions src/hotkey/grab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions src/hotkey/grab.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#ifndef _GRAB_H_INCLUDED_
#define _GRAB_H_INCLUDED_

#include <glib.h>

void grab_keys();
void ungrab_keys();
gboolean setup_filter();
void setup_filter();
void release_filter();

#endif
2 changes: 1 addition & 1 deletion src/hotkey/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/hotkey/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/hotkey/plugin.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _PLUGIN_H_INCLUDED_
#define _PLUGIN_H_INCLUDED_

#include <glib.h>

#define TYPE_KEY 0
#define TYPE_MOUSE 1

Expand Down Expand Up @@ -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

0 comments on commit 3dda8a5

Please sign in to comment.