Wrong focus window via XGetInputFocus when input focus is on Activity
Hi,
I am using a sample application to print out current input focus window via XGetInputFocus
#include <stdio.h>
#include <unistd.h>
#include <X11/Xlib.h>
int main()
{
Display *display;
Window window;
int revert;
char *name;
display = XOpenDisplay(NULL);
if (!display)
fprintf(stderr, "Failed to open display!\n");
while (1) {
XGetInputFocus(display, &window, &revert);
XFetchName(display, window, &name);
printf("window:%#x name:%s\n", window, name);
XFree(name);
sleep(1);
}
}
To reproduce the problem, I used following steps:
- Run the sample application in terminal, printing out the window handle and name every one second
- Focus on window, e.g., the Terminal or Browser.
- Press Win key to activate Activity view. Stay there for a few seconds.
Problem:
XGetInputFocus still reports the same input focus window when on Activity view. Shouldn't the input focus window change? Since the input focus is on another window already.
The XGetInputFocus behavior to report true input focus window is currently use by Wine. Reporting the same window while the input focus is in fact on another window cause Wine to behave incorrectly for some games. I am not familiar with GNOME-Shell stack. It seems that Panel and the Activity view, Window Switcher by Alt+Tab are special windows. Is there really a problem with GNOME or should Wine use different methods to find the input focus window?
Thanks,
Zhiyi Zhang