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 352383 - Compiz patches
Compiz patches
Status: RESOLVED OBSOLETE
Product: libwnck
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: 2.20.x
Assigned To: libwnck maintainers
libwnck maintainers
ewmh
Depends on:
Blocks:
 
 
Reported: 2006-08-22 12:59 UTC by Vincent Untz
Modified: 2018-01-24 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
01_libwnck_window_move.patch (2.39 KB, patch)
2006-10-02 21:13 UTC, Elijah Newren
none Details | Review
02_libwnck_appearance.patch (20.10 KB, patch)
2006-10-02 21:14 UTC, Elijah Newren
none Details | Review
03_libwnck_viewport.patch (8.81 KB, patch)
2006-10-02 21:14 UTC, Elijah Newren
none Details | Review
04_libwnck_above.patch (695 bytes, patch)
2006-10-02 21:15 UTC, Elijah Newren
none Details | Review
_NET_WM_STATE_ABOVE patch (669 bytes, patch)
2007-01-30 13:05 UTC, Travis Watkins
rejected Details | Review
viewport patch (10.58 KB, patch)
2007-01-30 13:08 UTC, Travis Watkins
none Details | Review
Add support for ACTION_ABOVE and ACTION_BELOW (1.25 KB, patch)
2007-04-11 17:34 UTC, Elijah Newren
committed Details | Review
Get/set opacity/saturation/brightness support for windows (12.28 KB, patch)
2007-05-10 15:32 UTC, Vincent Untz
none Details | Review
Updated viewport patch (9.78 KB, patch)
2007-07-03 04:40 UTC, Robert Carr
none Details | Review
New patch for viewport support in the action menu (21.09 KB, patch)
2007-07-08 10:54 UTC, Vincent Untz
none Details | Review
wnck-viewports-support.patch (20.89 KB, patch)
2007-07-10 00:37 UTC, guillaume
none Details | Review

Description Vincent Untz 2006-08-22 12:59:52 UTC
Frédéric just sent me this link: http://www.compiz.info/patches/

There are some patches for libwnck there, so we should probably look at them.
Comment 1 Daniel Holbach 2006-10-02 12:14:31 UTC
https://launchpad.net/distros/ubuntu/+source/libwnck/+bug/63208 is about the same patches and has some explanatory remarks by the authors:


"""
The above patch fixes the above checkbox to work with compiz... from within the patch itself:
"There's no _NET_WM_ACTION_ABOVE hint so always add it if window manager claims to support_NET_WM_STATE_ABOVE"

The viewport patch gives libwnck support for viewports which are used by compiz/beryl instead of workspaces, this is an fdo standard. So, we need to add viewports support to libwnck to replace workspaces if we use compiz/beryl. If not, there is no possibility/entry in the menu to change viewport/workspace.

The move patch is needed to have the viewport support patch, they work together.

The apperance patch is only for eyecandy, it adds an apperance entry in the menu that lets the users choose the opacity/britghness/saturation of the window, as well as providing a simple way to reset all those values.

The french patch simply updates the french translation (one of the patch authors was french). This probably could have its own ticket.

"""
Comment 2 Elijah Newren 2006-10-02 19:14:31 UTC
http://www.compiz.info/patches/libwnck/01_libwnck_window_move.patch looks good other than the existence of tabs  ;-).  We likely already have an open bug on it (with Magnus Therning filing or commenting on it; he's working on implementing it in metacity, at the very least, with the idea that he can then use libwnck to move windows)

http://www.compiz.info/patches/libwnck/02_libwnck_appearance.patch looks fine except for the fact that _NET_WM_WINDOW_OPACITY, _NET_WM_WINDOW_SATURATION, and _NET_WM_WINDOW_BRIGHTNESS are not part of the EWMH yet.  They should be pushed on wm-spec-list before we adopt the patch, IMO.

http://www.compiz.info/patches/libwnck/03_libwnck_viewport.patch has one or two spacing issues (e.g. if/else blocks should actually line up, 2 spaces after an if/else, not tabs), but other than that minor nitpick looks just fine.

http://www.compiz.info/patches/libwnck/04_libwnck_above.patch looks fine, but we should probably push a _NET_WM_ACTION_ABOVE on wm-spec-list also.

I'm not qualified to comment on the french translation.
Comment 3 Elijah Newren 2006-10-02 21:12:36 UTC
See bug 342899, for Magnus' bug...

I was going to branch and fixup/commit some of these, but I need to get a metacity release out and then start the gnome 2.16.1 build.  So, I'll attach all the compiz patches here in case they get changed on the server (in order to make future reviews a bit easier).
Comment 4 Elijah Newren 2006-10-02 21:13:49 UTC
Created attachment 73899 [details] [review]
01_libwnck_window_move.patch
Comment 5 Elijah Newren 2006-10-02 21:14:09 UTC
Created attachment 73900 [details] [review]
02_libwnck_appearance.patch
Comment 6 Elijah Newren 2006-10-02 21:14:34 UTC
Created attachment 73901 [details] [review]
03_libwnck_viewport.patch
Comment 7 Elijah Newren 2006-10-02 21:15:16 UTC
Created attachment 73902 [details] [review]
04_libwnck_above.patch
Comment 8 Matthew Garrett 2006-10-04 17:04:20 UTC
The viewport patch adds the string "Viewport" to the visible UI. Is that something we really want? I've had to go and read the spec to find out what the difference between a viewport and a workspace is, and other than the fact that windows can overlap viewports but not workspaces I'm not really sure that there's a user-visible difference.

Would it be possible to continue referring to viewports as "Workspaces" in user-visible contexts? The only case I can think of where this would be an issue is if a user genuinely has a setup with multiple workspaces, each containing multiple viewports. In that case, falling back to mention viewports would seem reasonable.
Comment 9 Havoc Pennington 2006-10-05 04:50:19 UTC
There aren't really any inherent differences in what the user experience can be for the two EWMH concepts of workspace and viewport (*especially* with a compositing manager which can draw whatever it wants). I don't think we should confuse those EWMH implementation concepts with the currently user-visible concept of "a workspace."

The EWMH differences are entirely a matter of implementation convenience of certain features, some things are easier to code or work more smoothly if the WM is implemented one way, some are easier to code if the WM is implemented another way.

i.e. it's just two ways to implement something, like a binary tree vs. a hash table. Having this implementation choice rename things in the UI or introduce new user-visible concepts is pretty weird. You have to understand X11 and window management at a fairly deep level to even know what the heck the tradeoffs between the two implementation choices are.

The main user-visible issue is whether a window can be partly on two different workspaces at the same time (i.e. whether workspaces in the user's mental model are distinct collections of windows, or distinct areas of a conceptually large screen). But I think this user experience choice is largely independent of the implementation choice of which EWMH hint to use, esp. in a compositing-manager world.

Anyway in short if a WM does only EWMH-viewports or EWMH-workspaces I would think libwnck should display those the same way, and call them both workspaces, as Matthew suggests.

A WM could also make the user experience choice to let you nest one workspace-ish thing inside another slightly different workspace-ish thing, and try to come up with good user visible names for both workspace-ish things. I have no idea how to make this sane from a user experience standpoint, which is why metacity never did it, but assuming a libwnck patch attempts to do it, there's no reason that the language and implementation model of EWMH necessarily has to leak into the UI in the process.

Quite possibly compiz creates a better user model for showing this sort of thing. For example, perhaps you could just call EWMH-workspaces "cubes" or something like that and call EWMH-viewports "workspaces." This could work user-experience-wise, I don't know. But note that coming at it top-down like this you might not name things as they are in the protocol spec.

Does compiz really do the nesting thing though, or does it just have viewports instead?
Comment 10 Elijah Newren 2006-10-05 16:54:12 UTC
In addition to the issues Matthew and Havoc point out about 03_libwnck_viewport.patch, let me change my mind about a few other things: 

01_libwnck_window_move.patch does not set the source indication as required in the spec.  Also, since we already have wnck_window_set_geometry(), wnck_window_move() should use it instead of writing a new _wnck_move_resize() function.  So it needs a little bit of work but is still mostly okay?

04_libwnck_above.patch: why don't we just push _NET_WM_ACTION_ABOVE on the wm-spec-list and use it instead?
Comment 11 drago01 2006-12-29 12:19:03 UTC
last comment was on  2006-10-05 
whats the status of this?
are the patches merged yet or are do they still have some issues?
Comment 12 Daniel Holbach 2006-12-29 13:29:06 UTC
Drago: I personally find that http://bugzilla.gnome.org/show_bug.cgi?id=352383#c9 and http://bugzilla.gnome.org/show_bug.cgi?id=352383#c2 give enough explanation of what's still missing. Are there any efforts from Compiz upstreams going on wrt wm-spec-list?
Comment 13 David Reveman 2006-12-29 18:55:38 UTC
01_libwnck_window_move.patch - I wrote this patch before libwnck had a set_window_geometry function. With the set_window_geometry function in place this patch is no longer useful.

02_libwnck_appearance.patch - I guess the opacity part is OK if the hint is pushed to the EWMH spec. BTW, a lot of clients change this property directly for managed windows. I believe that this should be a window/compositing manager owned property and client messages should be used by clients to change the property for a managed window, just like all other wm owned properties.

03_libwnck_viewport.patch - This patch is broken. It includes calls to wnck_window_get_workspace without checking that the result is != NULL. Changing every occurrence of

workspace = wnck_window_get_workspace (amd->window);

to something like:

if (wnck_window_is_pinned (amd->window))
    workspace = wnck_screen_get_active_workspace (wnck_window_get_screen (amd->window));
else
    workspace = wnck_window_get_workspace (amd->window);

if (!workspace)
    goto bail;

should make it better.

04_libwnck_above.patch - Yes, _NET_WM_ACTION_ABOVE and _NET_WM_ACTION_BELOW should be pushed to the EWMH spec. This patch was just a simple fix to make it work in sled10.

Comment 14 David Reveman 2006-12-29 19:09:06 UTC
(In reply to comment #9)
> There aren't really any inherent differences in what the user experience can be
> for the two EWMH concepts of workspace and viewport (*especially* with a
> compositing manager which can draw whatever it wants). I don't think we should
> confuse those EWMH implementation concepts with the currently user-visible
> concept of "a workspace."

I think there are some significant differences. There's not really a limited set of viewports as there is with workspaces. The viewport can be positioned pretty much anywhere within the virtual desktop area. But if we don't expose this functionality, the currently user-visible concept of "a workspace" can be used for both.

I think everything that is useful with the viewport concept can be implemented as workspaces. Compositing manager or not doesn't matter. However, you'll end up with a lot of hacks in your WM code, like moving and changing desktop for all client windows as you change the current desktop. Most importantly, pagers and similar clients will not be aware of the viewport like functionality provided by the WM and it will end up confusing for the user. This is why I used the viewport concept when implementing the cube plugin for compiz. Clients aware of the viewport concept would just work and those that didn't could be fixed without hacking or extending the EWMH spec.

Making _NET_WM_DESKTOP (or adding a new hint that contains) a list of desktops and adding something like a _NET_WM_POSITION hint that contains a list of window positions for each desktop would make it possible to do properly implement the cube plugin using the workspace concept instead.

> 
> The EWMH differences are entirely a matter of implementation convenience of
> certain features, some things are easier to code or work more smoothly if the
> WM is implemented one way, some are easier to code if the WM is implemented
> another way.
> 
> i.e. it's just two ways to implement something, like a binary tree vs. a hash
> table. Having this implementation choice rename things in the UI or introduce
> new user-visible concepts is pretty weird. You have to understand X11 and
> window management at a fairly deep level to even know what the heck the
> tradeoffs between the two implementation choices are.

As I explained above, I think there's a bit more to it than just two implementation choices. Making sure that existing clients work reasonably well is important.

> 
> The main user-visible issue is whether a window can be partly on two different
> workspaces at the same time (i.e. whether workspaces in the user's mental model
> are distinct collections of windows, or distinct areas of a conceptually large
> screen). But I think this user experience choice is largely independent of the
> implementation choice of which EWMH hint to use, esp. in a compositing-manager
> world.

The EWMH hint used only makes it possible for other clients to be aware of the WM state and manipulate it to some degree. To me it makes sense to pick the hint that gives the most accurate view of real WM state. Whether the WM lives in a compositing-manager world or not doesn't really matter, it just makes the possible WM states much greater.

> 
> Anyway in short if a WM does only EWMH-viewports or EWMH-workspaces I would
> think libwnck should display those the same way, and call them both workspaces,
> as Matthew suggests.

I agree. In the viewport case we should just split the large desktop area in screen sized chunks (like my viewport patch is doing) and call them workspaces.

> 
> A WM could also make the user experience choice to let you nest one
> workspace-ish thing inside another slightly different workspace-ish thing, and
> try to come up with good user visible names for both workspace-ish things. I
> have no idea how to make this sane from a user experience standpoint, which is
> why metacity never did it, but assuming a libwnck patch attempts to do it,
> there's no reason that the language and implementation model of EWMH
> necessarily has to leak into the UI in the process.
> 
> Quite possibly compiz creates a better user model for showing this sort of
> thing. For example, perhaps you could just call EWMH-workspaces "cubes" or
> something like that and call EWMH-viewports "workspaces." This could work
> user-experience-wise, I don't know. But note that coming at it top-down like
> this you might not name things as they are in the protocol spec.
> 
> Does compiz really do the nesting thing though, or does it just have viewports
> instead?

The core of compiz allows both things to exist. However, there's no plugin afaik that creates a visual representation of multiple workspaces and switching workspace without that will just look like switching workspace in a normal wm so most people don't use it. A plugin that visualizes workspaces as multiple cubes will probably be available soon and people will likely start using it then.

Comment 15 Travis Watkins 2007-01-30 13:05:14 UTC
Created attachment 81510 [details] [review]
_NET_WM_STATE_ABOVE patch

This should fix the spacing problems with the _NET_WM_STATE_ABOVE patch.
Comment 16 Travis Watkins 2007-01-30 13:08:27 UTC
Created attachment 81511 [details] [review]
viewport patch

Changes:
  * use "Workspace" instead of "Viewport" in strings
  * NULL check on the workspace variable
  * only show "Move to Another Workspace" if you don't have a window pinned
  * fix spacing problems

Hopefully this is good to commit now.
Comment 17 Travis Watkins 2007-01-30 13:11:08 UTC
Oh, forgot to mention the viewport patch uses wnck_window_set_geometry now so the wnck_window_move patch is no longer needed.

I don't think the Appearance patch is worth having so I'm not going to do work on it.
Comment 18 Travis Watkins 2007-03-03 20:58:45 UTC
*bump*

Can someone take a look at the updated patches?
Comment 19 drago01 2007-03-04 16:02:53 UTC
I am using your _NET_WM_STATE_ABOVE.patch since you uploaded it here and I never had any problem with it. 
I don't see any reasons why this patches shouldn't go in.
Comment 20 Matthias Clasen 2007-03-25 13:12:40 UTC
The right thing to do here is still to get NET_WM_ACTION_ABOVE in the EWMH...
Comment 22 Ray Strode [halfline] 2007-03-29 14:34:37 UTC
discussion from comment 21 got moved to:
http://mail.gnome.org/archives/wm-spec-list/2007-March/msg00016.html
Comment 23 Elijah Newren 2007-04-11 17:34:55 UTC
Created attachment 86190 [details] [review]
Add support for ACTION_ABOVE and ACTION_BELOW
Comment 24 Elijah Newren 2007-04-11 17:46:44 UTC
As discussed on compiz and wm-spec lists as well as here, I think the right fix is just getting ACTION_ABOVE into the EWMH and then supporting it, rather than working around the fact that window managers can't yet advertise it.  Since Matthias already proposed this EWMH change a couple weeks ago, I'm going ahead and commiting the fix now and will modify later if someone objects to the proposal soon on wm-spec-list.
Comment 25 Vincent Untz 2007-04-29 11:34:13 UTC
Travis: the patches modifying window-action-menu.c might need an update for trunk.
Comment 26 Vincent Untz 2007-05-10 15:32:15 UTC
Created attachment 87961 [details] [review]
Get/set opacity/saturation/brightness support for windows

This is patch 73900 updated to trunk, and without the menu items added to the action menu. I don't think we want those menu items. However the new API can be useful.

Elijah: my only worry is that this uses _NET_WM_WINDOW_OPACITY _NET_WM_WINDOW_SATURATION and _NET_WM_WINDOW_BRIGHTNESS which are not in EWMH yet, I believe. Should they be added to the spec first?
Comment 27 Elijah Newren 2007-05-11 04:25:39 UTC
(In reply to comment #26)
> Elijah: my only worry is that this uses _NET_WM_WINDOW_OPACITY
> _NET_WM_WINDOW_SATURATION and _NET_WM_WINDOW_BRIGHTNESS which are not in EWMH
> yet, I believe. Should they be added to the spec first?
 
Yes, I still think so (see comment 2) and David also mentioned as much (see comment 13).
Comment 28 Vincent Untz 2007-06-10 14:27:05 UTC
Add ewmh to whiteboard to indicate that we need some work in EWMH for this bug.
Comment 29 Vincent Untz 2007-06-29 17:07:37 UTC
I'd really love to have someone update the viewport patch.

I'm not quite sure if (and how) we should handle the case when the wm is using a viewport and workspaces, though.
Comment 30 Robert Carr 2007-07-03 04:40:02 UTC
Created attachment 91081 [details] [review]
Updated viewport patch

Viewport patch that applies to latest SVN
Comment 31 Vincent Untz 2007-07-05 13:11:09 UTC
Thanks for the update Robert!

We still need to decide what to do when there are both workspaces and viewports.
Comment 32 Matthias Clasen 2007-07-05 13:42:45 UTC
Can't we just declare that an unsupported configuration ? I mean,
do we really have any window manager which support such configurations ?
Comment 33 Travis Watkins 2007-07-05 16:12:57 UTC
Compiz supports both but using both is not something I can imagine someone doing.
Comment 34 Elijah Newren 2007-07-06 03:06:41 UTC
(In reply to comment #32)
> Can't we just declare that an unsupported configuration ? 

+1 from me.
Comment 35 Vincent Untz 2007-07-08 10:54:19 UTC
Created attachment 91420 [details] [review]
New patch for viewport support in the action menu

Ok, since it doesn't make sense to have both at the same time, it also doesn't make sense to create menu items for viewports and workspaces.

Now, the actions are doing workspace stuff if there's more than one workspace and viewport stuff if there's only one workspace.

Can someone with compiz test the patch to see if it works?
Comment 36 Vincent Untz 2007-07-08 10:55:16 UTC
(of course, ignore my TODO list that's at the top of test-tasklist.c ;-))
Comment 37 guillaume 2007-07-08 22:26:59 UTC
I have just tried this using Compiz and libwnck svn.
The "Only on this workspace/Always visible" radios aren't working correctly (it is always "Always visible" whatever I do, while it isn't on all viewports)
The workspace switcher is somehow working, but current vieport is always the "Viewport 1" and the other viewports are considered relatively to the current viewport (e.g. if I'm on Viewport 2 and selected "Move to Viewport 3" the window is moved to Viewport 4)
Comment 38 guillaume 2007-07-10 00:37:03 UTC
Created attachment 91523 [details] [review]
wnck-viewports-support.patch

Okay, my bad for the radios button, I hadn't understood how it worked (by the way, I think that the behavior of the pin/unpin button should be reversed and reflect current situation, not what it would change, since it's a radio button ; but that's off topic)

I looked at the patch and I guess I fixed it (at least it now works perfectly on my setup). Current viewport is now detected properly (using wnck_workspace_get_viewport_x/y) and move up/down/left/right actions are correctly available (with the previous patch only the right one was ever available since it wasn't detecting current viewport correctly). Move to workspace was a bit harder to fix. First it looks like using wnck_window_get_client_window_geometry instead of wnck_window_get_geometry is needed, because of some Compiz oddities when it comes to decorations handling (otherwise the "content" window left corner is moved at the position of the "content + decorations" window left corner, just exactly why one shouldn't use _get_client_window_geometry usually (as far as what I have read in the _get_geometry function comments)). Then wnck_window_set_geometry apparently works relatively to the current viewport so substracting current viewport x/y to destination x/y was also needed (it looks like it is more a move function than an absolute function).
Comment 39 Vincent Untz 2007-07-10 07:59:32 UTC
Guillaume: thanks for the update. However, I fixed the patch in the train yesterday ;-) I'll commit it soon.
Comment 40 Vincent Untz 2007-07-10 09:32:42 UTC
(In reply to comment #39)
> Guillaume: thanks for the update. However, I fixed the patch in the train
> yesterday ;-) I'll commit it soon.

Committed.
Comment 41 GNOME Infrastructure Team 2018-01-24 13:36:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libwnck/issues/71.