summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2014-07-24 10:37:41 +0400
committerinfirit <[email protected]>2014-11-25 18:06:24 +0100
commitb25395fab6fe9ee38bc0cd359941d0a825d88451 (patch)
treee7b6720a543a00495fae1dd1423d652056bedb03 /src/core
parentb8d8e52f0effbf76ff909f88932098d4daf4336e (diff)
downloadmarco-b25395fab6fe9ee38bc0cd359941d0a825d88451.tar.bz2
marco-b25395fab6fe9ee38bc0cd359941d0a825d88451.tar.xz
merge metacity(gtk3) changes
merge metacity(gtk3) changes fix warnings clean up unused variables replace UNUSED_VARIABLE by G_GNUC_UNUSED
Diffstat (limited to 'src/core')
-rw-r--r--src/core/display.c21
-rw-r--r--src/core/errors.c11
-rw-r--r--src/core/keybindings.c1
-rw-r--r--src/core/main.c8
-rw-r--r--src/core/testasyncgetprop.c19
-rw-r--r--src/core/window.c22
6 files changed, 29 insertions, 53 deletions
diff --git a/src/core/display.c b/src/core/display.c
index 8a81d8f4..6a4831fb 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1482,6 +1482,15 @@ static gboolean maybe_send_event_to_gtk(MetaDisplay* display, XEvent* xevent)
return FALSE;
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (gdk_display_device_is_grabbed(gdk_display, device))
+#else
+ if (gdk_display_pointer_is_grabbed(gdk_display))
+#endif
+ {
+ return FALSE;
+ }
+
switch (xevent->type)
{
@@ -2843,9 +2852,15 @@ key_event_description (Display *xdisplay,
XEvent *event)
{
#ifdef HAVE_XKB
- KeySym keysym = XkbKeycodeToKeysym(xdisplay, event->xkey.keycode, 0, 0);
- const char *str = XKeysymToString (keysym);
- return g_strdup_printf ("Key '%s' state 0x%x", str ? str : "none", event->xkey.state);
+ KeySym keysym;
+ const char *str;
+
+ keysym = XkbKeycodeToKeysym (xdisplay, event->xkey.keycode, 0, 0);
+
+ str = XKeysymToString (keysym);
+
+ return g_strdup_printf ("Key '%s' state 0x%x",
+ str ? str : "none", event->xkey.state);
#else
return "none";
#endif
diff --git a/src/core/errors.c b/src/core/errors.c
index 0dd43dc0..c2cf82d0 100644
--- a/src/core/errors.c
+++ b/src/core/errors.c
@@ -30,12 +30,6 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#ifdef __GNUC__
-#define UNUSED_VARIABLE __attribute__ ((unused))
-#else
-#define UNUSED_VARIABLE
-#endif
-
#if !GTK_CHECK_VERSION (3, 0, 0)
static int x_error_handler (Display *display,
XErrorEvent *error);
@@ -162,10 +156,7 @@ meta_error_trap_pop_internal (MetaDisplay *display,
* assumes that there are no pending GDK traps from GDK itself
*/
- int UNUSED_VARIABLE (* restored_error_handler) (Display *,
- XErrorEvent *);
-
- restored_error_handler = XSetErrorHandler (x_error_handler);
+ XSetErrorHandler (x_error_handler);
/* remove this */
display->error_trap_handler = NULL;
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 81b1c47f..9e809b68 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1311,6 +1311,7 @@ meta_display_process_key_event (MetaDisplay *display,
#ifdef HAVE_XKB
keysym = XkbKeycodeToKeysym (display->xdisplay, event->xkey.keycode, 0, 0);
+
str = XKeysymToString (keysym);
#else
str = NULL;
diff --git a/src/core/main.c b/src/core/main.c
index 66a5cdfb..d6d789e2 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -69,12 +69,6 @@
#include <time.h>
#include <unistd.h>
-#ifdef __GNUC__
-#define UNUSED_VARIABLE __attribute__ ((unused))
-#else
-#define UNUSED_VARIABLE
-#endif
-
/**
* The exit code we'll return to our parent process when we eventually die.
*/
@@ -382,7 +376,7 @@ sigterm_handler (int signum)
{
if (sigterm_pipe_fds[1] >= 0)
{
- int UNUSED_VARIABLE dummy;
+ G_GNUC_UNUSED int dummy;
dummy = write (sigterm_pipe_fds[1], "", 1);
close (sigterm_pipe_fds[1]);
diff --git a/src/core/testasyncgetprop.c b/src/core/testasyncgetprop.c
index 826d7f41..d357dbea 100644
--- a/src/core/testasyncgetprop.c
+++ b/src/core/testasyncgetprop.c
@@ -81,12 +81,6 @@ print_backtrace (void)
}
#endif
-#ifdef __GNUC__
-#define UNUSED_VARIABLE __attribute__ ((unused))
-#else
-#define UNUSED_VARIABLE
-#endif
-
static int error_trap_depth = 0;
static int
@@ -422,7 +416,6 @@ run_speed_comparison (Display *xdisplay,
while ((task = ag_get_next_completed_task (xdisplay)))
{
- int UNUSED_VARIABLE result;
Atom actual_type;
int actual_format;
unsigned long n_items;
@@ -432,12 +425,12 @@ run_speed_comparison (Display *xdisplay,
assert (ag_task_have_reply (task));
data = NULL;
- result = ag_task_get_reply_and_free (task,
- &actual_type,
- &actual_format,
- &n_items,
- &bytes_after,
- &data);
+ ag_task_get_reply_and_free (task,
+ &actual_type,
+ &actual_format,
+ &n_items,
+ &bytes_after,
+ &data);
if (data)
XFree (data);
diff --git a/src/core/window.c b/src/core/window.c
index d34845e8..95d49885 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -54,12 +54,6 @@
#include <X11/extensions/shape.h>
#endif
-#ifdef __GNUC__
-#define UNUSED_VARIABLE __attribute__ ((unused))
-#else
-#define UNUSED_VARIABLE
-#endif
-
static int destroying_windows_disallowed = 0;
@@ -5348,12 +5342,11 @@ meta_window_client_message (MetaWindow *window,
else if (event->xclient.message_type ==
display->atom__NET_MOVERESIZE_WINDOW)
{
- int gravity, UNUSED_VARIABLE source;
+ int gravity;
guint value_mask;
gravity = (event->xclient.data.l[0] & 0xff);
value_mask = (event->xclient.data.l[0] & 0xf00) >> 8;
- source = (event->xclient.data.l[0] & 0xf000) >> 12;
if (gravity == 0)
gravity = window->size_hints.win_gravity;
@@ -5396,7 +5389,6 @@ meta_window_client_message (MetaWindow *window,
else if (event->xclient.message_type ==
display->atom__NET_WM_FULLSCREEN_MONITORS)
{
- MetaClientType UNUSED_VARIABLE source_indication;
gulong top, bottom, left, right;
meta_verbose ("_NET_WM_FULLSCREEN_MONITORS request for window '%s'\n",
@@ -5406,7 +5398,7 @@ meta_window_client_message (MetaWindow *window,
bottom = event->xclient.data.l[1];
left = event->xclient.data.l[2];
right = event->xclient.data.l[3];
- source_indication = event->xclient.data.l[4];
+ /* source_indication = event->xclient.data.l[4]; */
meta_window_update_fullscreen_monitors (window, top, bottom, left, right);
}
@@ -5607,8 +5599,6 @@ static gboolean
process_property_notify (MetaWindow *window,
XPropertyEvent *event)
{
- Window UNUSED_VARIABLE xid = window->xwindow;
-
if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */
{
char *property_name = XGetAtomName (window->display->xdisplay,
@@ -5619,12 +5609,6 @@ process_property_notify (MetaWindow *window,
XFree (property_name);
}
- if (event->atom == window->display->atom__NET_WM_USER_TIME &&
- window->user_time_window)
- {
- xid = window->user_time_window;
- }
-
meta_window_reload_property (window, event->atom, FALSE);
return TRUE;
@@ -6849,7 +6833,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
{
MetaRectangle titlebar_rect;
GList *onscreen_region;
- int UNUSED_VARIABLE titlebar_size;
gboolean is_onscreen;
const int min_height_needed = 8;
@@ -6863,7 +6846,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
/* Get the rectangle corresponding to the titlebar */
meta_window_get_outer_rect (window, &titlebar_rect);
titlebar_rect.height = window->frame->child_y;
- titlebar_size = meta_rectangle_area (&titlebar_rect);
/* Run through the spanning rectangles for the screen and see if one of
* them overlaps with the titlebar sufficiently to consider it onscreen.