FocusIn/FocusOut not generated

前端 未结 1 705
半阙折子戏
半阙折子戏 2021-01-23 13:06

Can someone please clarify the default focus handling of the X11 server? My understanding is that the focus \'follows the mouse\' and sure enough if I move the mouse between sep

相关标签:
1条回答
  • 2021-01-23 13:33

    Having focus refers to the window which receives keyboard input when you press a key.

    The focus handling depends on your window manager. The most common mode is click to focus, which your window manager is set to, where you only get focus when you click on the window. An alternative is that the keyboard focus follows the mouse, which is what you are expecting.

    There should be a setting to change this in your window manager settings.

    The cursor changing does not indicate focus, just that the terminal has defined a different cursor.

    To demonstrate, open a terminal and an xev window.

    • Click on the xev window and press a key, you will see key events.
    • Move the mouse to the terminal window, you'll see the motion and leave events
    • Press a key and you'll still see key events from xev
    • Click on the terminal window, xev will give a focus out event
    • Press a key, the characters will be displayed in the terminal window
    • Move the mouse over the xev window and press a key, the character will still come out in the terminal window
    0 讨论(0)
提交回复
热议问题