After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685856 - osk: appear on the monitor where the focus is
osk: appear on the monitor where the focus is
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: keyboard
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-10-10 03:19 UTC by Matthias Clasen
Modified: 2012-12-28 17:59 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
Layout: show the OSK on the monitor where the focused window lives (9.78 KB, patch)
2012-10-14 17:54 UTC, Giovanni Campagna
needs-work Details | Review
Layout: show the OSK on the monitor where the focused window lives (12.73 KB, patch)
2012-10-15 20:29 UTC, Giovanni Campagna
none Details | Review
OSK multi-monitor fixes (5.14 KB, patch)
2012-11-19 14:31 UTC, Rui Matos
none Details | Review
keyboard: Show in an idle on clutter key focus changes (2.72 KB, patch)
2012-11-19 14:37 UTC, Rui Matos
reviewed Details | Review
Layout: show the OSK on the monitor where the focused window lives (12.41 KB, patch)
2012-11-20 16:41 UTC, Giovanni Campagna
committed Details | Review
keyboard: Show in an idle on clutter key focus changes (2.73 KB, patch)
2012-12-03 09:26 UTC, Rui Matos
committed Details | Review

Description Matthias Clasen 2012-10-10 03:19:45 UTC
The on screen keyboard doesn't appear on the second monitor if that's where the login "dialog"/screen is. It should. 

(See https://live.gnome.org/Boston2012/Multimonitor )
Comment 1 Giovanni Campagna 2012-10-14 17:54:13 UTC
Created attachment 226419 [details] [review]
Layout: show the OSK on the monitor where the focused window lives

In multimonitor scenarios, it makes sense to show the OSK close to
the window that will actually receive keystrokes.
Comment 2 drago01 2012-10-14 20:15:57 UTC
Review of attachment 226419 [details] [review]:

::: js/ui/keyboard.js
@@ +545,3 @@
+    },
+
+    _getFocusMonitor: function() {

We already have simlar methods in layout.js ... we should reuse them and not re implement them here. like chrome._findMonitorForWindow (make it public) and findMonitorForActor
Comment 3 Giovanni Campagna 2012-10-15 20:29:16 UTC
Created attachment 226503 [details] [review]
Layout: show the OSK on the monitor where the focused window lives

In multimonitor scenarios, it makes sense to show the OSK close to
the window that will actually receive keystrokes.
Comment 4 Matthias Clasen 2012-10-29 02:26:06 UTC
would be nice to get this in - pretty basic multi-monitor functionality
Comment 5 Rui Matos 2012-10-29 15:25:21 UTC
Giovanni, the patch isn't really complete yet, right? Anyway I'm looking into this now, please do yell if I'm stepping on your toes :-)
Comment 6 Giovanni Campagna 2012-10-29 15:57:38 UTC
It's not complete because it's not tested and thus probably buggy, but the code is that.
Comment 7 Rui Matos 2012-11-19 14:31:48 UTC
Created attachment 229369 [details] [review]
OSK multi-monitor fixes

--

The patch here looks generally fine but needs a few fixes on
top. Giovanni can you look over these fixes and squash it with your
patch if you agree with them?

Note that we need to be able to set the monitor separately from
showKeyboard() because _redraw() needs to know the monitor to properly
draw the OSK.
Comment 8 Rui Matos 2012-11-19 14:37:31 UTC
Created attachment 229372 [details] [review]
keyboard: Show in an idle on clutter key focus changes

It's common to do actor.grab_key_focus() before the actor is mapped
which means that we can't reliably determine where the actor is at
notify::key-focus time and thus might end up showing the keyboard on
the wrong monitor.

This is happening, in particular, with the run dialog. Delaying until
we hit the main loop allows us to know where the actor finally is
before showing the OSK.
Comment 9 Giovanni Campagna 2012-11-20 16:41:24 UTC
Created attachment 229483 [details] [review]
Layout: show the OSK on the monitor where the focused window lives

In multimonitor scenarios, it makes sense to show the OSK close to
the window that will actually receive keystrokes.

The fixes made sense, so I squashed them as asked.
Comment 10 Rui Matos 2012-11-20 16:56:31 UTC
Review of attachment 229483 [details] [review]:

Thanks, looks good.
Comment 11 Giovanni Campagna 2012-11-20 16:58:26 UTC
Comment on attachment 229483 [details] [review]
Layout: show the OSK on the monitor where the focused window lives

Attachment 229483 [details] pushed as 8a7c031 - Layout: show the OSK on the monitor where the focused window lives
Comment 12 Giovanni Campagna 2012-12-02 22:45:17 UTC
Review of attachment 229372 [details] [review]:

Uhm, I guess I could review this one, having written the other half...

::: js/ui/keyboard.js
@@ +283,3 @@
+        this._clearShowIdle();
+        this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE,
+                                         Lang.bind(this, function() { this.Show(time); }));

It would be better to check if _showIdleId != 0, and not add the idle in that case, as remove and adding idles is not free.
Comment 13 Rui Matos 2012-12-03 09:26:35 UTC
Created attachment 230508 [details] [review]
keyboard: Show in an idle on clutter key focus changes

--
(In reply to comment #12)
> It would be better to check if _showIdleId != 0, and not add the idle in that
> case, as remove and adding idles is not free.

Fixed. Thanks
Comment 14 Giovanni Campagna 2012-12-10 22:42:22 UTC
Review of attachment 230508 [details] [review]:

Yes.
Comment 15 Matthias Clasen 2012-12-19 19:20:11 UTC
Should we land this ?
Comment 16 Matthias Clasen 2012-12-28 17:59:55 UTC
Attachment 230508 [details] pushed as f07fee5 - keyboard: Show in an idle on clutter key focus changes