[X11] How to get mouse movement back after SDL crash
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[X11] How to get mouse movement back after SDL crash
Hello everybody,
this one is bugging me for ages now, but I have never stumbled upon a solution:
From time to time a fullscreen SDL application crashes or hangs and has to be killed. However, afterwards I often cannot move the mouse cursor anymore and sometimes cannot change resolution with Ctrl-'+' / Ctrl-'-'
What I do as a workaround is to start another SDL application which graps the mouse, and quit it sanely. But is there a proper way to let X reassign the Pointer device or whatever?
I played around with xsetpointer, but could not let it do something useful.
This is probably because SDL still has a hold on the mouse, despite the fact that you killed the app. xsetpointer will have no effect if this is the case, because SDL is still interfering with the pointer. You may have to look at the running processes and kill any SDL-related programs that may still be running, and/or restart X. Make sure to file a bug report against the unstable app.
Yeah, that's the problem. But I am sure there are no other processes running which utilize SDL.
So I guess when the application crashed it had still grabbed the mouse, but without calling SDL_Quit() it stays that way and X does not care to re-grab it without being told so.
Restarting X is not necessary, since everything is fine after I started another SDL app as a workaround.
Maybe I'll just hack together a small C program which does nothing but initializing SDL, grabbing the mouse, relasing it and quitting sanely.
I am not a programmer at all, but I had a look at a tutorial and it didn't look to hard...
Anyway, if there is a prober way to solve that with X11's own utilities, I'd like to know it!
Unfortunately, running a program that starts and sanely stops SDL *is* the "proper" way to fix this--SDL's lock on the pointer involves a lot of low-level system interfacing that X was never designed to know to repair in the event of a crash, and only a call to SDL_Quit() can undo SDL's interference (short of killing X). Again, make sure to file a bug report with the developers so they can fix this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.