Compilation fix for Gtk+ 3.0
This commit is contained in:
parent
39fd53606a
commit
3f601b57a6
|
@ -18,7 +18,10 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
||||||
# include <gdk/gdkx.h>
|
# include <gdk/gdkx.h>
|
||||||
|
#endif
|
||||||
#include <System.h>
|
#include <System.h>
|
||||||
#include "Desktop.h"
|
#include "Desktop.h"
|
||||||
|
|
||||||
|
@ -35,8 +38,10 @@ typedef struct _MessageCallback
|
||||||
|
|
||||||
/* prototypes */
|
/* prototypes */
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
||||||
static GdkFilterReturn _desktop_message_on_callback(GdkXEvent * xevent,
|
static GdkFilterReturn _desktop_message_on_callback(GdkXEvent * xevent,
|
||||||
GdkEvent * event, gpointer data);
|
GdkEvent * event, gpointer data);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* public */
|
/* public */
|
||||||
|
@ -45,6 +50,7 @@ static GdkFilterReturn _desktop_message_on_callback(GdkXEvent * xevent,
|
||||||
int desktop_message_register(char const * destination,
|
int desktop_message_register(char const * destination,
|
||||||
DesktopMessageCallback callback, void * data)
|
DesktopMessageCallback callback, void * data)
|
||||||
{
|
{
|
||||||
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
||||||
MessageCallback * mc;
|
MessageCallback * mc;
|
||||||
|
|
||||||
if((mc = malloc(sizeof(*mc))) == NULL)
|
if((mc = malloc(sizeof(*mc))) == NULL)
|
||||||
|
@ -53,6 +59,7 @@ int desktop_message_register(char const * destination,
|
||||||
mc->data = data;
|
mc->data = data;
|
||||||
gdk_add_client_message_filter(gdk_atom_intern(destination, FALSE),
|
gdk_add_client_message_filter(gdk_atom_intern(destination, FALSE),
|
||||||
_desktop_message_on_callback, mc);
|
_desktop_message_on_callback, mc);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +68,7 @@ int desktop_message_register(char const * destination,
|
||||||
int desktop_message_send(char const * destination, uint32_t value1,
|
int desktop_message_send(char const * destination, uint32_t value1,
|
||||||
uint32_t value2, uint32_t value3)
|
uint32_t value2, uint32_t value3)
|
||||||
{
|
{
|
||||||
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
||||||
GdkEvent event;
|
GdkEvent event;
|
||||||
GdkEventClient * client = &event.client;
|
GdkEventClient * client = &event.client;
|
||||||
|
|
||||||
|
@ -74,12 +82,14 @@ int desktop_message_send(char const * destination, uint32_t value1,
|
||||||
client->data.l[1] = value2;
|
client->data.l[1] = value2;
|
||||||
client->data.l[2] = value3;
|
client->data.l[2] = value3;
|
||||||
gdk_event_send_clientmessage_toall(&event);
|
gdk_event_send_clientmessage_toall(&event);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
||||||
/* desktop_message_on_callback */
|
/* desktop_message_on_callback */
|
||||||
static GdkFilterReturn _desktop_message_on_callback(GdkXEvent * xevent,
|
static GdkFilterReturn _desktop_message_on_callback(GdkXEvent * xevent,
|
||||||
GdkEvent * event, gpointer data)
|
GdkEvent * event, gpointer data)
|
||||||
|
@ -102,3 +112,4 @@ static GdkFilterReturn _desktop_message_on_callback(GdkXEvent * xevent,
|
||||||
free(mc);
|
free(mc);
|
||||||
return GDK_FILTER_REMOVE;
|
return GDK_FILTER_REMOVE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user