]> git.mdlowis.com Git - projs/tide.git/commitdiff
raise, set focus, and set urgency
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Jan 2019 04:36:24 +0000 (23:36 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Jan 2019 04:36:24 +0000 (23:36 -0500)
src/registrar.c

index afef0c74c8ebe3ce8741ce9b83ed0a80f51488fe..49e8a72dfea369601e68937a6358d7620b04cc00 100644 (file)
@@ -105,6 +105,15 @@ void win_open(XConf* x, Window winid, char* path, char* addr) {
                 puts("window still valid, raising");
                 win_send(x, x->self, win->win, 0,  "GOTO", strtoul(addr, NULL, 0));
                 win_send(x, x->self, winid, 0,  "DONE", 0);
+                XMapRaised(x->display, win->win);
+                XSetInputFocus(x->display, win->win, RevertToNone, CurrentTime);
+                XWMHints *hints = XGetWMHints(x->display, win->win);
+                if (hints) {
+                    hints->flags |= XUrgencyHint;
+                    XSetWMHints(x->display, win->win, hints);
+                    XFree(hints);
+                }
+                XSync(x->display, False);
                 free(type);
                 return;
             }