[GH-ISSUE #557] Preventing mouse pointer being locked into firejail Xephyr? #393

Closed
opened 2026-05-05 05:46:18 -06:00 by gitea-mirror · 9 comments
Owner

Originally created by @laniakea64 on GitHub (Jun 6, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/557

Environment
Lubuntu 14.04
firejail self build from a81568d4f0
Firefox 46.0.1

Steps to reproduce

  1. start Openbox in firejail Xephyr, with firefox profile: firejail --ignore=noroot --profile=~/.config/firejail/firefox.profile --x11 openbox (or even: firejail --noprofile --x11 openbox)
  2. from Openbox menu, open Terminal emulator, from there run Firefox
  3. type Ctrl-Shift-J to open Firefox's Browser Console

Now the mouse pointer is locked inside the Xephyr, the only way I've found to get it back is to switch to a different tty (Ctrl-Alt-F1) and kill the Xephyr PID with SIGINT. 😕

Can this sort of mouse pointer "stealing" be prevented, either by firejail or some other means?
Or is there some other (guaranteed) way to get the mouse pointer back in these situations without switching tty or quitting the Xephyr?

Thanks in advance.

Originally created by @laniakea64 on GitHub (Jun 6, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/557 **Environment** Lubuntu 14.04 firejail self build from https://github.com/netblue30/firejail/commit/a81568d4f03a12817ab2b0ad6d52159eb5a9eb10 Firefox 46.0.1 **Steps to reproduce** 1) start Openbox in firejail Xephyr, with firefox profile: `firejail --ignore=noroot --profile=~/.config/firejail/firefox.profile --x11 openbox` (or even: `firejail --noprofile --x11 openbox`) 2) from Openbox menu, open Terminal emulator, from there run Firefox 3) type Ctrl-Shift-J to open Firefox's Browser Console Now the mouse pointer is locked inside the Xephyr, the only way I've found to get it back is to switch to a different tty (Ctrl-Alt-F1) and kill the Xephyr PID with SIGINT. :confused: Can this sort of mouse pointer "stealing" be prevented, either by firejail or some other means? Or is there some other (guaranteed) way to get the mouse pointer back in these situations without switching tty or quitting the Xephyr? Thanks in advance.
gitea-mirror 2026-05-05 05:46:18 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@netblue30 commented on GitHub (Jun 6, 2016):

It looks like Xephyr grabs the keyboard and the mouse when you press Ctrl-Shift. If you press Ctrl-Shift again it will release the mouse. According to these http://superuser.com/questions/280375/how-to-change-default-behavior-of-xephyr-for-capturing-and-releasing-keyboard-mo people, it is hardcoded in Xephyr.

Maybe Ctrl-Shift can be redirected to something else using xmodmap utility, but in that case ctrl-shift-J will not work in Firefox.

<!-- gh-comment-id:224017880 --> @netblue30 commented on GitHub (Jun 6, 2016): It looks like Xephyr grabs the keyboard and the mouse when you press Ctrl-Shift. If you press Ctrl-Shift again it will release the mouse. According to these http://superuser.com/questions/280375/how-to-change-default-behavior-of-xephyr-for-capturing-and-releasing-keyboard-mo people, it is hardcoded in Xephyr. Maybe Ctrl-Shift can be redirected to something else using xmodmap utility, but in that case ctrl-shift-J will not work in Firefox.
Author
Owner

@laniakea64 commented on GitHub (Jun 6, 2016):

Good to know that it's not the sandboxed application doing this 👍
I see now that Ctrl-Shift is what's grabbing the mouse, but Ctrl-Shift again does not release the mouse in a firejail Xephyr. However, the second Ctrl-Shift does correctly release the mouse in a non-firejail Xephyr.
Some investigation points to the use of the Xephyr command-line option -title as the culprit.

As a work-around, can firejail please add an option to disable the use of the -title Xephyr command-line option?

<!-- gh-comment-id:224034399 --> @laniakea64 commented on GitHub (Jun 6, 2016): Good to know that it's not the sandboxed application doing this :+1: I see now that Ctrl-Shift is what's grabbing the mouse, but Ctrl-Shift again does **not** release the mouse in a firejail Xephyr. However, the second Ctrl-Shift does correctly release the mouse in a non-firejail Xephyr. Some investigation points to the use of the Xephyr command-line option `-title` as the culprit. As a work-around, can firejail please add an option to disable the use of the `-title` Xephyr command-line option?
Author
Owner

@netblue30 commented on GitHub (Jun 6, 2016):

I can exit with a single Ctrl-Shift when using Firejail. I'll document the behavior, the title stays.

<!-- gh-comment-id:224071484 --> @netblue30 commented on GitHub (Jun 6, 2016): I can exit with a single Ctrl-Shift when using Firejail. I'll document the behavior, the title stays.
Author
Owner

@laniakea64 commented on GitHub (Jun 6, 2016):

I can exit with a single Ctrl-Shift when using Firejail.

I'm hitting this problem even in the Lubuntu 16.04 live CD environment, specifying -title is preventing Ctrl-Shift from releasing mouse and keyboard.
How are you getting it to work?

<!-- gh-comment-id:224092145 --> @laniakea64 commented on GitHub (Jun 6, 2016): > I can exit with a single Ctrl-Shift when using Firejail. I'm hitting this problem even in the Lubuntu 16.04 live CD environment, specifying `-title` is preventing Ctrl-Shift from releasing mouse and keyboard. How are you getting it to work?
Author
Owner

@netblue30 commented on GitHub (Jun 7, 2016):

I'll bring something in shortly.

<!-- gh-comment-id:224264121 --> @netblue30 commented on GitHub (Jun 7, 2016): I'll bring something in shortly.
Author
Owner

@netblue30 commented on GitHub (Jun 9, 2016):

Fixed! Install the version from git, and edit /etc/firejail/firejail.config file. You need to add "xephyr-window-title no" at the end.

<!-- gh-comment-id:224953588 --> @netblue30 commented on GitHub (Jun 9, 2016): Fixed! Install the version from git, and edit /etc/firejail/firejail.config file. You need to add "xephyr-window-title no" at the end.
Author
Owner

@laniakea64 commented on GitHub (Jun 9, 2016):

Nice 😃 Confirmed fixed by ecaf0cb4ed, thanks!

<!-- gh-comment-id:224998833 --> @laniakea64 commented on GitHub (Jun 9, 2016): Nice :smiley: Confirmed fixed by https://github.com/netblue30/firejail/commit/ecaf0cb4edcc9f216af7c0bfd238db6b2516c799, thanks!
Author
Owner

@netblue30 commented on GitHub (Jun 10, 2016):

No problem, if you find out anything else just let me know.

<!-- gh-comment-id:225174619 --> @netblue30 commented on GitHub (Jun 10, 2016): No problem, if you find out anything else just let me know.
Author
Owner

@alextrekov3307 commented on GitHub (Mar 11, 2020):

This problem is still present. Why isn't xephyr-window-title a valid command line argument?

<!-- gh-comment-id:597811319 --> @alextrekov3307 commented on GitHub (Mar 11, 2020): This problem is still present. Why isn't xephyr-window-title a valid command line argument?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#393
No description provided.