From 5450dcca0be9d90e9f2046b0ca1383b4fae130ca Mon Sep 17 00:00:00 2001 From: o9000 Date: Fri, 8 May 2015 21:49:26 +0200 Subject: [PATCH] Attempt to fix new window title race in fvwm --- src/taskbar/task.c | 6 ++++-- src/tint.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/taskbar/task.c b/src/taskbar/task.c index 1bb4138..b75466e 100644 --- a/src/taskbar/task.c +++ b/src/taskbar/task.c @@ -50,6 +50,9 @@ Task *add_task (Window win) if (!win) return 0; if (window_is_hidden(win)) return 0; + XSelectInput(server.dsp, win, PropertyChangeMask|StructureNotifyMask); + XFlush(server.dsp); + int monitor; if (nb_panel > 1) { monitor = window_get_monitor (win); @@ -75,8 +78,7 @@ Task *add_task (Window win) get_title(&new_tsk); get_icon(&new_tsk); - //printf("task %s : desktop %d, monitor %d\n", new_tsk->title, desktop, monitor); - XSelectInput (server.dsp, new_tsk.win, PropertyChangeMask|StructureNotifyMask); + //printf("new task %s win %u: desktop %d, monitor %d\n", new_tsk.title, win, new_tsk.desktop, monitor); GPtrArray* task_group = g_ptr_array_new(); Taskbar *tskbar; diff --git a/src/tint.c b/src/tint.c index 7890972..e9e5b1b 100644 --- a/src/tint.c +++ b/src/tint.c @@ -727,6 +727,7 @@ void event_property_notify (XEvent *e) } else { tsk = task_get_task (win); + //printf("change win = %u, task = %p\n", win, tsk); if (!tsk) { if (at != server.atom._NET_WM_STATE) return;