diff --git a/mcs-plugin/wmtweaks_plugin.c b/mcs-plugin/wmtweaks_plugin.c index 45c49c3e620d91886f24fcf7906da23970b93d68..65ae3bc90078d3306f08021ecb9d41bad5bd75ef 100644 --- a/mcs-plugin/wmtweaks_plugin.c +++ b/mcs-plugin/wmtweaks_plugin.c @@ -495,7 +495,8 @@ static void setup_dialog (Itf * itf) { xfce_gtk_window_center_on_monitor_with_pointer (GTK_WINDOW (itf->tweaks_dialog)); - gdk_x11_window_set_user_time(GTK_WIDGET (itf->tweaks_dialog)->window, GDK_CURRENT_TIME); + gdk_x11_window_set_user_time(GTK_WIDGET (itf->tweaks_dialog)->window, + gdk_x11_get_server_time (GTK_WIDGET (itf->tweaks_dialog)->window)); gtk_widget_show (itf->tweaks_dialog); } diff --git a/mcs-plugin/xfwm4_plugin.c b/mcs-plugin/xfwm4_plugin.c index 23dbb287734b3866804d694e7501f69345b447e0..0fda2d8a1964fe4b4b1ba3091aace6541188fcb4 100644 --- a/mcs-plugin/xfwm4_plugin.c +++ b/mcs-plugin/xfwm4_plugin.c @@ -1871,7 +1871,8 @@ setup_dialog (Itf * itf) g_signal_connect (G_OBJECT (itf->box_resize_check), "toggled", G_CALLBACK (cb_box_resize_changed), itf); xfce_gtk_window_center_on_monitor_with_pointer (GTK_WINDOW (itf->xfwm4_dialog)); - gdk_x11_window_set_user_time(GTK_WIDGET (itf->xfwm4_dialog)->window, GDK_CURRENT_TIME); + gdk_x11_window_set_user_time(GTK_WIDGET (itf->xfwm4_dialog)->window, + gdk_x11_get_server_time (GTK_WIDGET (itf->xfwm4_dialog)->window)); gtk_widget_show (itf->xfwm4_dialog); } diff --git a/src/focus.c b/src/focus.c index 205833d45e52a520d7d98552ead070350c623863..df6f942f84b1396a09e43ee91ab47e69101aea49 100644 --- a/src/focus.c +++ b/src/focus.c @@ -145,9 +145,15 @@ clientFocusNew(Client * c) } else if ((client_focus) && (prevent_focus_stealing)) { - if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_STARTUP_TIME | CLIENT_FLAG_HAS_USER_TIME)) + if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_STARTUP_TIME) && (c->user_time == (Time) 0)) { - if ((c->user_time != (Time) 0) && (c->user_time < client_focus->user_time)) + TRACE ("Given startup time is 0, not focusing"); + give_focus = FALSE; + prevented = TRUE; + } + else if (FLAG_TEST (c->flags, CLIENT_FLAG_HAS_STARTUP_TIME | CLIENT_FLAG_HAS_USER_TIME)) + { + if (c->user_time < client_focus->user_time) { TRACE ("Current %u, new %u", (unsigned int) client_focus->user_time, (unsigned int) c->user_time); give_focus = FALSE;