-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse grabbing and Moving on X11 #1300
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Closed similar issues:
|
Diagnostic information
|
Adding a Log seems unnecessary, but ok |
WslLogs-2024-11-30_05-23-24.zip
Windows Version
Microsoft Windows [Version 10.0.22631.4460]
WSL Version
2.3.26.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.167.4-1
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
Simply open an X11 Window with C and try to use the XGrabPointer function or try to define an "invisible" (empty texture) cursor with XDefineCursor.
I put my code in Diagnostic Log.
compile with: cc filename.c -lX11 -lXext -I/usr/include -L/usr/lib
run with: ./a.out
Expected Behavior
For XGrabPointer the mouse events should only be passed to the X11 Window, so that the Mouse is basically trapped inside. The window basically reserves the mouse pointer.
For XDefineCursor the Cursor Image should be set to the passed Image.
I tested these functions also on my other laptop where the same Ubuntu is installed normally (without wsl) everything there works as expected.
Actual Behavior
Even after XGrapPointer the mouse moves freely over the screen and isn't reserved by the window.
Instead of an custom image the cursor also just shows the standard image. (Changing the cursor image with XCreateFontCursor works)
Diagnostic Logs
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
struct color_struct {
unsigned long black, white;
};
#define SCREEN (DefaultScreen(display))
#define ROOT_WINDOW (DefaultRootWindow(display))
Cursor create_invisible_cursor(Display *display, Window root) {
Pixmap bitmap_no_data;
XColor black;
static char no_data[] = { 0,0,0,0,0,0,0,0 };
black.red = black.green = black.blue = 0;
}
int main(void) {
int depth;
char *display_name;
struct color_struct *color = malloc(sizeof(struct color_struct));
}
The text was updated successfully, but these errors were encountered: