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 642591 - Application launcher (Alt+F2) placed on wrong display in multihead setup
Application launcher (Alt+F2) placed on wrong display in multihead setup
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-17 17:38 UTC by Radek Lát
Modified: 2012-06-09 03:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
show modal Dialogs on monitor with the mouse pointer (984 bytes, patch)
2012-06-08 05:21 UTC, darkxst
needs-work Details | Review
remove focusMonitor/focusIndex as they are no longer needed. (1.83 KB, patch)
2012-06-08 06:53 UTC, darkxst
none Details | Review
patch mutter to make meta_screen_get_current_monitor() public (5.20 KB, patch)
2012-06-08 08:24 UTC, darkxst
reviewed Details | Review
show modal Dialogs on monitor with the mouse pointer (799 bytes, patch)
2012-06-08 08:28 UTC, darkxst
needs-work Details | Review
clean up whitespace and fixed commit message (5.53 KB, patch)
2012-06-08 21:25 UTC, darkxst
none Details | Review
implement get currentMonitor property. (1.31 KB, patch)
2012-06-08 21:34 UTC, darkxst
none Details | Review
rebased (1.30 KB, patch)
2012-06-08 21:36 UTC, darkxst
none Details | Review
modalDialog: show dialogs on monitor with the mouse pointer (2.24 KB, patch)
2012-06-08 22:38 UTC, darkxst
committed Details | Review
screen: Add new public meta_screen_get_current_monitor API (5.58 KB, patch)
2012-06-08 22:43 UTC, darkxst
committed Details | Review

Description Radek Lát 2011-02-17 17:38:13 UTC
Description of problem:
When using multiple monitors and application launcher is opened by Alt+F2 shortcut, it always appears on a screen with some active windows, but the launched application itself appears on a screen with cursor.

Version-Release number of selected component (if applicable):
control-center-2.91.6-8.fc15.x86_64

How reproducible: 100%

Steps to Reproduce:
1. Have at least two monitors, place some application window on one of them and cursor on the other one.
2. Press Alt+F2 (assuming there is default shortcut configuration)
3. Type name of some app (for example gedit)
  
Actual results:
Application launcher appears on screen with active window, the newly launched application (gedit) appears on the other screen with cursor.

Expected results:
They both should appear on the same screen (with cursor).

Additional info:
Observed on Fedora 15 Alpha / TC2
Comment 1 darkxst 2012-05-21 20:54:53 UTC
This bug still exists in gnome-shell 3.4.1
Comment 2 darkxst 2012-06-08 05:21:36 UTC
Created attachment 215893 [details] [review]
show modal Dialogs on monitor with the mouse pointer

I think the expected behaviour here is to show the dialog on the monitor containing the mouse pointer, rather than the monitor with active focused window. This is more inline with the behaviour seen when launching applications.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-06-08 06:34:49 UTC
Review of attachment 215893 [details] [review]:

global.screen.get_current_monitor() ?
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-06-08 06:42:06 UTC
Review of attachment 215893 [details] [review]:

Remove focusMonitor/focusIndex from layout.js as well - this is the only place they're being used.
Comment 5 darkxst 2012-06-08 06:53:35 UTC
Created attachment 215908 [details] [review]
remove focusMonitor/focusIndex as they are no longer needed.
Comment 6 darkxst 2012-06-08 08:24:54 UTC
Created attachment 215918 [details] [review]
patch mutter to make meta_screen_get_current_monitor() public

also get_current_monitor() now returns an index to be more consistent with the other API such as get_primary_monitor().
Comment 7 darkxst 2012-06-08 08:28:50 UTC
Created attachment 215919 [details] [review]
show modal Dialogs on monitor with the mouse pointer

use get_current_monitor() to get index of monitor to show the dialogs on.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-06-08 08:33:38 UTC
Review of attachment 215919 [details] [review]:

Did you test this? An integer shouldn't have 'x', 'y', 'width' and 'height' properties. :)

This should be Main.layoutManager.monitors[global.screen.get_current_monitor()];

Maybe it's worth adding a get currentMonitor() { } property for it, similar to focusMonitor.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-06-08 08:34:44 UTC
Review of attachment 215918 [details] [review]:

Your commit message needs work. Try something like:

    screen: Add new public meta_screen_get_current_monitor API

    Similar to meta_screen_get_primary_monitor, this returns the index
    of the current monitor - the monitor the pointer is on.

::: src/core/screen.c
@@ +2120,3 @@
   g_queue_free (monitor_queue);
 }
+const MetaMonitorInfo* 

Introduces trailing whitespace, and also missing leading and trailing newlines before and after the function.

It also should have a doc comment describing that the current monitor is the monitor "the pointer" is on (oh boy, this is not going to work with XI2, is it)
Comment 10 darkxst 2012-06-08 21:25:53 UTC
Created attachment 215996 [details] [review]
clean up whitespace and fixed commit message
Comment 11 darkxst 2012-06-08 21:34:49 UTC
Created attachment 215998 [details] [review]
implement get currentMonitor property.
Comment 12 darkxst 2012-06-08 21:36:01 UTC
Created attachment 215999 [details] [review]
rebased
Comment 13 darkxst 2012-06-08 22:38:10 UTC
Created attachment 216011 [details] [review]
modalDialog: show dialogs on monitor with the mouse pointer

Show the dialog on the monitor containing the pointer, rather than
the monitor with active focused window. This brings it inline with
the behaviour seen when launching applications.

Remove the focusMonitor/focusIndex from LayoutManager. These
properties were only used by the modal dialogs. Remove them since
they are not being used elsewhere.
Comment 14 darkxst 2012-06-08 22:43:40 UTC
Created attachment 216012 [details] [review]
screen: Add new public meta_screen_get_current_monitor API

Similar to meta_screen_get_primary_monitor, this returns a monitor index.
The monitor that the pointer is on. The previous private implementation
has been renamed to meta_screen_get_current_monitor_info.
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-06-08 22:46:01 UTC
Review of attachment 216012 [details] [review]:

Looks fine.
Comment 16 Jasper St. Pierre (not reading bugmail) 2012-06-08 22:46:30 UTC
Review of attachment 216011 [details] [review]:

This as well.
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-06-09 03:07:17 UTC
Comment on attachment 216012 [details] [review]
screen: Add new public meta_screen_get_current_monitor API

Attachment 216012 [details] pushed as 4595209 - screen: Add new public meta_screen_get_current_monitor API
Comment 18 Jasper St. Pierre (not reading bugmail) 2012-06-09 03:07:27 UTC
Attachment 216011 [details] pushed as dc004f6 - modalDialog: show dialogs on monitor with the mouse pointer