diff options
author | Pierre Ossman <ossman@cendio.se> | 2025-02-19 14:26:45 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2025-02-19 14:26:45 +0100 |
commit | 917f4b9149f95fec17455c3ebf6020af87799a07 (patch) | |
tree | f35be976945ff241c4f82aebc0cc94ad1528b883 /vncviewer | |
parent | 7c9f4328b69e3c0a02757757be26ae2e5c54e1fe (diff) | |
download | tigervnc-917f4b9149f95fec17455c3ebf6020af87799a07.tar.gz tigervnc-917f4b9149f95fec17455c3ebf6020af87799a07.zip |
Keep input methods constantly disabled
It is unfortunately not reliable to turn them on and off with focus, at
least not on macOS. We lose focus when the layout selector is opened.
Which means the disabled layouts are available to the user to chose, and
the result is a bit random.
We currently don't have a practical need to re-enable input methods once
the session is running as we don't have any input fields at this point.
So for now, simply disable the input methods constantly whilst connected
to work around the issue.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/Viewport.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index d643fa37..9c6dd202 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -107,6 +107,12 @@ Viewport::Viewport(int w, int h, const rfb::PixelFormat& /*serverPF*/, CConn* cc // We need to intercept keyboard events early Fl::add_system_handler(handleSystemEvent, this); + // FIXME: We should only disable this whilst we have keyboard focus, + // but we also need to keep it disabled when we lose focus to + // any layout selector so it can properly filter out the + // layouts we don't support + Fl::disable_im(); + frameBuffer = new PlatformPixelBuffer(w, h); assert(frameBuffer); cc->setFramebuffer(frameBuffer); @@ -150,6 +156,7 @@ Viewport::~Viewport() } delete keyboard; + Fl::enable_im(); // FLTK automatically deletes all child widgets, so we shouldn't touch // them ourselves here @@ -479,8 +486,6 @@ int Viewport::handle(int event) return 1; case FL_FOCUS: - Fl::disable_im(); - flushPendingClipboard(); // We may have gotten our lock keys out of sync with the server @@ -499,8 +504,6 @@ int Viewport::handle(int event) case FL_UNFOCUS: // We won't get more key events, so reset our knowledge about keys resetKeyboard(); - - Fl::enable_im(); return 1; case FL_KEYDOWN: |