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 691744 - window: Add convenience method for workspace checks
window: Add convenience method for workspace checks
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: 691746
 
 
Reported: 2013-01-14 22:36 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-01-18 20:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Add convenience method for workspace checks (2.17 KB, patch)
2013-01-14 22:36 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
window: Add convenience method for workspace checks (3.93 KB, patch)
2013-01-18 19:41 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
window: Make meta_window_located_on_workspace() public (2.57 KB, patch)
2013-01-18 20:37 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Use meta_window_located_on_workspace() in more places (2.29 KB, patch)
2013-01-18 20:37 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-01-14 22:36:28 UTC
This is designed to replace code like:

    window.get_workspace() == workspace || window.is_on_all_workspaces();

which is a bit unwieldy.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-01-14 22:36:30 UTC
Created attachment 233473 [details] [review]
window: Add convenience method for workspace checks
Comment 2 Giovanni Campagna 2013-01-18 19:31:19 UTC
Review of attachment 233473 [details] [review]:

I prefer "meta_window_is_on_workspace()", is_displayed implies that the window is visible, and conflicts with showing_with_its_workspace.
Comment 3 Giovanni Campagna 2013-01-18 19:31:20 UTC
Review of attachment 233473 [details] [review]:

I prefer "meta_window_is_on_workspace()", is_displayed implies that the window is visible, and conflicts with showing_with_its_workspace.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-01-18 19:41:50 UTC
Created attachment 233790 [details] [review]
window: Add convenience method for workspace checks

This is designed to replace code like:

    window.get_workspace() == workspace || window.is_on_all_workspaces();

which is a bit unwieldy.
Comment 5 Giovanni Campagna 2013-01-18 19:50:13 UTC
Review of attachment 233790 [details] [review]:

Yes.

::: src/core/window.c
@@ +10404,3 @@
+ * @workspace: a #MetaWorkspace
+ *
+ * Returns whether @window is displayed on @workspace, *or whether it

Typo.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-01-18 20:37:39 UTC
Created attachment 233797 [details] [review]
window: Make meta_window_located_on_workspace() public

We have some code in gnome-shell that does the equivalent of:

    window.get_workspace() == workspace || window.is_on_all_workspaces();

which is a bit unwieldy. We already have a method in mutter,
so use that and document it.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-01-18 20:37:41 UTC
Created attachment 233798 [details] [review]
Use meta_window_located_on_workspace() in more places
Comment 8 Giovanni Campagna 2013-01-18 20:43:20 UTC
Review of attachment 233797 [details] [review]:

Yes.
Comment 9 Giovanni Campagna 2013-01-18 20:43:39 UTC
Review of attachment 233798 [details] [review]:

Yes.
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-01-18 20:45:25 UTC
Attachment 233797 [details] pushed as d8eb47e - window: Make meta_window_located_on_workspace() public
Attachment 233798 [details] pushed as df15843 - Use meta_window_located_on_workspace() in more places