Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Author
Skunnyk@skunnyk
said:Yes, verve-focus utility has been removed from version 2, see https://mail.xfce.org/pipermail/xfce-announce/2018-April/000601.html
- Author
Pavel Goran said:(In reply to Skunnyk from comment 1)
Yes, verve-focus utility has been removed from version 2, see https://mail.xfce.org/pipermail/xfce-announce/2018-April/000601.html
Well, this is a major regression, making the plugin next to useless (at least for me).
- Author
Skunnyk@skunnyk
said:That's why the author ask for help: "verve-focus has been dropped, because I don't have the knowledge or time necessary to maintain it. If you can get it working, let me know."
- Gaël Bonithon added 1. Regression 2. Feature labels
added 1. Regression 2. Feature labels
- Maintainer
Let's mark this as both feature request and regression, if anyone has the motivation...
Also related to #10 (closed) since it's a lack that follows the GTK 3 port.
Edited by Gaël Bonithon - Gaël Bonithon marked this issue as related to #10 (closed)
marked this issue as related to #10 (closed)
A quick & dirty hack around:
#include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> #include <string.h> const char *TARGET_WINDOW_NAME = "xfce4-panel"; int window_has_exact_name(Display *display, Window window, const char *name) { XTextProperty window_name; if (XGetWMName(display, window, &window_name) && window_name.value) { int match = (strcmp((char *)window_name.value, name) == 0); XFree(window_name.value); return match; } return 0; } Window find_window_by_name_recursive(Display *display, Window window, const char *name) { Window root, parent, *children; unsigned int nchildren; if (window_has_exact_name(display, window, name)) { return window; } // Recursively search child windows if (XQueryTree(display, window, &root, &parent, &children, &nchildren)) { for (unsigned int i = 0; i < nchildren; i++) { Window found = find_window_by_name_recursive(display, children[i], name); if (found) { XFree(children); return found; } } XFree(children); } return 0; // No match found } void focus_window(Display *display, Window window) { if (!window) { fprintf(stderr, "Invalid window ID.\n"); return; } if (XSetInputFocus(display, window, RevertToParent, CurrentTime) == BadMatch) { fprintf(stderr, "Failed to set input focus: The window may not be focusable.\n"); return; } XRaiseWindow(display, window); XFlush(display); } int main() { Display *display = XOpenDisplay(NULL); if (!display) { fprintf(stderr, "Failed to open X display. Ensure the DISPLAY environment variable is set.\n"); return 1; } Window root = DefaultRootWindow(display); Window window = find_window_by_name_recursive(display, root, TARGET_WINDOW_NAME); if (!window) { fprintf(stderr, "No window with the name '%s' was found in the window hierarchy.\n", TARGET_WINDOW_NAME); XCloseDisplay(display); return 1; } focus_window(display, window); XCloseDisplay(display); return 0; }
build with
gcc -o verve-focus verve-focus.c -lX11