summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-08 14:47:57 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-08 14:47:57 +0200
commit65268f66f1ddd3c110c1161278cb4cb943f8cfa0 (patch)
tree430d43740abf2c00dda2a9519db0d08f55313fc2
parenta75e92d21ce608894cc99eb6b3e2cc616726c395 (diff)
downloadulock-65268f66f1ddd3c110c1161278cb4cb943f8cfa0.tar
ulock-65268f66f1ddd3c110c1161278cb4cb943f8cfa0.zip
Ensure the ulock window is not shown when we wait for another instancev2
-rw-r--r--ulock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ulock.c b/ulock.c
index 7edfb05..9ac8ac8 100644
--- a/ulock.c
+++ b/ulock.c
@@ -33,7 +33,7 @@ enum lock_state {
static enum lock_state state = LOCKED;
static GtkWidget *window, *unlockWindow, *lockLabel, *promptEntry, *messageLabel, *logoutButton, *unlockButton;
-static gboolean enablePromptEntry = TRUE, enableLogoutButton = FALSE, enableUnlockButton = TRUE;
+static gboolean present = FALSE, enablePromptEntry = TRUE, enableLogoutButton = FALSE, enableUnlockButton = TRUE;
static char *username;
static char *logoutCommand = NULL;
@@ -213,7 +213,7 @@ static GdkFilterReturn xevent_filter(GdkXEvent *xevent, GdkEvent *event, gpointe
switch (ev->xany.type) {
case MapNotify:
case ConfigureNotify:
- if (ev->xany.window != gdk_x11_window_get_xid(gtk_widget_get_window(window)))
+ if (present && ev->xany.window != gdk_x11_window_get_xid(gtk_widget_get_window(window)))
gtk_window_present(GTK_WINDOW(window));
break;
@@ -346,6 +346,8 @@ int main(int argc, char *argv[]) {
load_config();
create_lock_window();
+
+ present = TRUE;
gtk_widget_show(window);
gtk_main();