[gtk+/wip/mir2] mir: check the log events env variable just once
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/mir2] mir: check the log events env variable just once
- Date: Tue, 2 Dec 2014 17:46:12 +0000 (UTC)
commit 7d3257af05e364a7efa250a692e8e0dd2af6280a
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Tue Dec 2 18:43:32 2014 +0100
mir: check the log events env variable just once
gdk/mir/gdkmireventsource.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
index df2ec92..7e4b9d0 100644
--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -41,6 +41,7 @@ struct _GdkMirEventSource
GMutex mir_event_lock;
GQueue mir_events;
+ gboolean log_events;
GdkDisplay *display;
};
@@ -401,9 +402,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
GdkWindow *window,
const MirEvent *event)
{
- if (g_getenv ("GDK_MIR_LOG_EVENTS"))
- _gdk_mir_print_event (event);
-
// FIXME: Only generate events if the window wanted them?
switch (event->type)
{
@@ -487,6 +485,9 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
}
}
+ if (source->log_events)
+ _gdk_mir_print_event (&event->event);
+
gdk_mir_event_source_queue_event (source->display, window, &event->event);
}
else
@@ -583,6 +584,7 @@ _gdk_mir_event_source_new (GdkDisplay *display)
source = (GdkMirEventSource *) g_source;
g_mutex_init (&source->mir_event_lock);
source->display = display;
+ source->log_events = (g_getenv ("GDK_MIR_LOG_EVENTS") != NULL);
return source;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]