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 654639 - shell-global cleanup/simplification
shell-global cleanup/simplification
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Giovanni Campagna
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-07-14 18:13 UTC by Dan Winship
Modified: 2011-08-03 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell-global: keep better track of screens and displays (15.39 KB, patch)
2011-07-14 18:13 UTC, Dan Winship
committed Details | Review
shell-global: add a "display" property (9.87 KB, patch)
2011-07-14 18:13 UTC, Dan Winship
committed Details | Review
shell-global: remove "gratuitous" meta_plugin_* calls (2.65 KB, patch)
2011-07-14 18:13 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2011-07-14 18:13:14 UTC
see patches
Comment 1 Dan Winship 2011-07-14 18:13:16 UTC
Created attachment 191992 [details] [review]
shell-global: keep better track of screens and displays

Rather than constantly asking mutter for the MetaScreen, and then
figuring out the MetaDisplay/Display/etc from there, just keep track
of everything we care about inside ShellGlobal.
Comment 2 Dan Winship 2011-07-14 18:13:19 UTC
Created attachment 191993 [details] [review]
shell-global: add a "display" property

and update callers to fetch that rather than doing
"global.screen.get_display()"
Comment 3 Dan Winship 2011-07-14 18:13:22 UTC
Created attachment 191994 [details] [review]
shell-global: remove "gratuitous" meta_plugin_* calls

MetaPlugin wraps a bunch of compositor (and plain metacity) methods
that we can just call ourselves, so just do that. (Presumably this
dates back to some ancient time when it was imagined that plugins
wouldn't need access to the full metacity API.)
Comment 4 Giovanni Campagna 2011-07-15 10:33:13 UTC
Review of attachment 191994 [details] [review]:

::: src/shell-global.c
@@ +703,3 @@
   g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL);
 
+  return meta_get_window_actors (global->meta_screen);

Can this be removed altogether, and callers do Meta.get_window_actors(global.screen)?
(or even better, change mutter API to meta_screen_get_window_actors, so global.screen.get_window_actors() works as expected)
Comment 5 Dan Winship 2011-07-18 18:51:43 UTC
(In reply to comment #4)
> Can this be removed altogether, and callers do
> Meta.get_window_actors(global.screen)?

Yes... although that's more typing.

> (or even better, change mutter API to meta_screen_get_window_actors, so
> global.screen.get_window_actors() works as expected)

The MetaScreen doesn't know about the MetaWindowActors though.

However, in almost every place where call get_window_actors(), we end up looking at both the MetaWindowActor and the MetaWindow, so maybe we should just expose meta_display_list_windows().

But this could happen later.
Comment 6 Dan Winship 2011-08-02 18:26:08 UTC
assigning to Giovanni for review since he already looked at it before...
Comment 7 Colin Walters 2011-08-02 20:10:56 UTC
Review of attachment 191994 [details] [review]:

It may also be worth nuking the old meta_plugin_ bits at some point too.

But this looks fine for now.
Comment 8 Colin Walters 2011-08-02 20:12:18 UTC
Review of attachment 191992 [details] [review]:

Looks obviously correct.
Comment 9 Colin Walters 2011-08-02 20:35:52 UTC
Review of attachment 191993 [details] [review]:

Looks good.
Comment 10 Dan Winship 2011-08-03 13:14:00 UTC
Attachment 191992 [details] pushed as b262a42 - shell-global: keep better track of screens and displays
Attachment 191993 [details] pushed as aed50e2 - shell-global: add a "display" property
Attachment 191994 [details] pushed as 7765d6a - shell-global: remove "gratuitous" meta_plugin_* calls