summaryrefslogtreecommitdiff
path: root/src/terminal-util.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-05-20 12:45:42 +0200
committerinfirit <[email protected]>2014-05-20 13:22:53 +0200
commit50ac67e11f946fb6539b30fbb86e60b94fa695d9 (patch)
tree5acef8e787da447ec51c4fd3b69f7a06cd13fbcb /src/terminal-util.c
parent0b75b3c4b4354b72b604c6313ceef97d9ecb007c (diff)
downloadmate-terminal-50ac67e11f946fb6539b30fbb86e60b94fa695d9.tar.bz2
mate-terminal-50ac67e11f946fb6539b30fbb86e60b94fa695d9.tar.xz
Cleanup GTK_CHECK_VERSION and unify gtk+2/3 code where possible
Always use gdk_window_get_display and GDK_WINDOW_XID Replace GtkObject with GObject Always use gtk_message_dialog_get_message_area (since gtk 2.22) Unify notebook code between gtk2 and gtk3
Diffstat (limited to 'src/terminal-util.c')
-rw-r--r--src/terminal-util.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 5cfa350..320afd1 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -45,10 +45,7 @@
#include "terminal-util.h"
#include "terminal-window.h"
-#if GTK_CHECK_VERSION(3, 0, 0)
- #define GDK_WINDOW_XWINDOW GDK_WINDOW_XID
- #define GDK_DRAWABLE_XID GDK_WINDOW_XID
-#else
+#if !GTK_CHECK_VERSION(3, 0, 0)
#define gdk_error_trap_pop_ignored gdk_error_trap_pop
#endif
@@ -1027,11 +1024,7 @@ gboolean
terminal_util_x11_get_net_wm_desktop (GdkWindow *window,
guint32 *desktop)
{
- #if GTK_CHECK_VERSION(3, 0, 0)
GdkDisplay *display = gdk_window_get_display (window);
- #else
- GdkDisplay *display = gdk_drawable_get_display (window);
- #endif
Atom type;
int format;
guchar *data;
@@ -1039,7 +1032,7 @@ terminal_util_x11_get_net_wm_desktop (GdkWindow *window,
gboolean result = FALSE;
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
- GDK_DRAWABLE_XID (window),
+ GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_DESKTOP"),
0, G_MAXLONG, False, AnyPropertyType,
@@ -1074,11 +1067,7 @@ terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
* http://bugzilla.mate.org/show_bug.cgi?id=586311 asks for GTK+
* to just handle everything behind the scenes including the desktop.
*/
- #if GTK_CHECK_VERSION(3, 0, 0)
GdkScreen *screen = gdk_window_get_screen (window);
- #else
- GdkScreen *screen = gdk_drawable_get_screen (window);
- #endif
GdkDisplay *display = gdk_screen_get_display (screen);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
char *wm_selection_name;
@@ -1103,7 +1092,7 @@ terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
xclient.type = ClientMessage;
xclient.serial = 0;
xclient.send_event = True;
- xclient.window = GDK_WINDOW_XWINDOW (window);
+ xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP");
xclient.format = 32;
@@ -1114,7 +1103,7 @@ terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
xclient.data.l[4] = 0;
XSendEvent (xdisplay,
- GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)),
+ GDK_WINDOW_XID (gdk_screen_get_root_window (screen)),
False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
@@ -1124,7 +1113,7 @@ terminal_util_x11_set_net_wm_desktop (GdkWindow *window,
gulong long_desktop = desktop;
XChangeProperty (xdisplay,
- GDK_DRAWABLE_XID (window),
+ GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_DESKTOP"),
XA_CARDINAL, 32, PropModeReplace,
@@ -1145,11 +1134,7 @@ void
terminal_util_x11_clear_demands_attention (GdkWindow *window)
{
- #if GTK_CHECK_VERSION(3, 0, 0)
GdkScreen *screen = gdk_window_get_screen (window);
- #else
- GdkScreen *screen = gdk_drawable_get_screen (window);
- #endif
GdkDisplay *display = gdk_screen_get_display (screen);
XClientMessageEvent xclient;
@@ -1157,7 +1142,7 @@ terminal_util_x11_clear_demands_attention (GdkWindow *window)
xclient.type = ClientMessage;
xclient.serial = 0;
xclient.send_event = True;
- xclient.window = GDK_WINDOW_XWINDOW (window);
+ xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE");
xclient.format = 32;
@@ -1168,7 +1153,7 @@ terminal_util_x11_clear_demands_attention (GdkWindow *window)
xclient.data.l[4] = 0;
XSendEvent (GDK_DISPLAY_XDISPLAY (display),
- GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)),
+ GDK_WINDOW_XID (gdk_screen_get_root_window (screen)),
False,
SubstructureRedirectMask | SubstructureNotifyMask,
(XEvent *)&xclient);
@@ -1186,11 +1171,7 @@ terminal_util_x11_clear_demands_attention (GdkWindow *window)
gboolean
terminal_util_x11_window_is_minimized (GdkWindow *window)
{
- #if GTK_CHECK_VERSION(3, 0, 0)
GdkDisplay *display = gdk_window_get_display (window);
- #else
- GdkDisplay *display = gdk_drawable_get_display (window);
- #endif
Atom type;
gint format;