diff options
author | Javier <dev.git@javispedro.com> | 2014-03-15 19:00:17 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2014-03-15 19:00:17 +0100 |
commit | fae72947043ae3b1627dac77b3c42bf2e1dbbd09 (patch) | |
tree | 43d90ae5e1f0f70db2ddd16ae6acbb101b92a2d8 /libtopmenu-client/topmenu-client.c | |
parent | cecc7efece527e09afdfb59dc24cbf6086bd2654 (diff) | |
download | topmenu-gtk-fae72947043ae3b1627dac77b3c42bf2e1dbbd09.tar.gz topmenu-gtk-fae72947043ae3b1627dac77b3c42bf2e1dbbd09.zip |
start porting to gtk3
Diffstat (limited to 'libtopmenu-client/topmenu-client.c')
-rw-r--r-- | libtopmenu-client/topmenu-client.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libtopmenu-client/topmenu-client.c b/libtopmenu-client/topmenu-client.c index 771920e..f7d3e58 100644 --- a/libtopmenu-client/topmenu-client.c +++ b/libtopmenu-client/topmenu-client.c @@ -3,6 +3,10 @@ #include "../global.h" +#if GTK_VERSION == 3 +#include <gtk/gtkx.h> +#endif + #include "topmenu-client.h" #define OBJECT_DATA_KEY_PLUG "topmenu-plug" @@ -23,10 +27,11 @@ static gboolean handle_widget_button_event(GtkWidget *widget, GdkEvent *event, G GdkWindow *socket = gtk_plug_get_socket_window(plug); if (socket) { + GdkDisplay * display = gdk_window_get_display(socket); GdkScreen *screen = gdk_window_get_screen(socket); GdkWindow *root = gdk_screen_get_root_window(screen); - Display *dpy = GDK_WINDOW_XDISPLAY(socket); - Window xwin = GDK_WINDOW_XWINDOW(socket); + Display *dpy = gdk_x11_display_get_xdisplay(display); + Window xwin = gdk_x11_window_get_xid(socket); if (event->type == GDK_BUTTON_PRESS) { gdk_display_pointer_ungrab(gtk_widget_get_display(widget), @@ -115,5 +120,5 @@ void topmenu_client_disconnect_window(GdkWindow *window) XDeleteProperty(display, xwin, atom); g_warn_if_fail(G_OBJECT(plug)->ref_count == 1); - gtk_widget_destroy(plug); + gtk_widget_destroy(GTK_WIDGET(plug)); } |