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 664780 - Allow changing the corner of the first WnckWorkspace.
Allow changing the corner of the first WnckWorkspace.
Status: RESOLVED OBSOLETE
Product: libwnck
Classification: Core
Component: pager
unspecified
Other All
: Normal enhancement
: ---
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-25 06:37 UTC by Andrzej
Modified: 2018-01-24 13:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added screen (and xutils) API for setting starting corner and orientation (10.26 KB, patch)
2011-11-26 15:09 UTC, Andrzej
none Details | Review
pager: added support for changing starting corner. (8.19 KB, patch)
2011-11-26 19:04 UTC, Andrzej
none Details | Review
screen: bugfix (pager changes are now propagated to the screen) (1.40 KB, patch)
2011-11-26 20:25 UTC, Andrzej
none Details | Review
pager: workspace ordering fix in horizontal mode (889 bytes, patch)
2011-11-27 06:44 UTC, Andrzej
none Details | Review

Description Andrzej 2011-11-25 06:37:44 UTC
Currently the first WnckWorkspace is always at the top left corner of the pager.

This feels awkward when the pager is in the vertical orientation. In vertical orientation the first workspace should be either at:
- bottom-left corner (if the pager is rotated 90 deg. counter clockwise), or
- top-right corner (if the pager is rotated 90 deg. clockwise).

Adding such functionality would require extending the API with something like:

void wnck_pager_set_origin (WnckPager *pager,
                            WnckPagerOrigin origin);
typedef enum {
  WNCK_PAGER_ORIGIN_TOP_LEFT, //current behavior, default
  WNCK_PAGER_ORIGIN_TOP_RIGHT,
  WNCK_PAGER_LAYOUT_BOTTOM_LEFT,
  WNCK_PAGER_LAYOUT_BOTTOM_RIGHT //for the sake of completeness, not really needed
} WnckPagerLayoutPolicy;

If such API extension can be accepted, I'll go ahead and implement this feature
on top of libwnck-2.30.
Comment 1 Vincent Untz 2011-11-25 14:19:44 UTC
Any such change should actually be reflected in the WnckScreen API. We have wnck_screen_try_set_workspace_layout() which doesn't take a corner, while it could (http://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#id2550891).

The WnckPager API should be called wnck_pager_set_starting_corner().

Bonus point if patch can be used in 3.x version :-)
Comment 2 Andrzej 2011-11-25 14:46:13 UTC
Thanks for the pointer. I wasn't aware of this spec - I'll change naming accordingly.

Do we have to change wnck_screen_try_set_workspace_layout() as well? I thought orientation or starting corner is only for changing the behavior of the view/presentation.

As for the 3.x version, see my reply in the bug #664779 report. I'll try to do it once I have a working 2.30 version.
Comment 3 Vincent Untz 2011-11-25 15:09:30 UTC
(In reply to comment #2)
> Do we have to change wnck_screen_try_set_workspace_layout() as well? I thought
> orientation or starting corner is only for changing the behavior of the
> view/presentation.

Yes, we need to change the WnckScreen API (actually, to stay API compatible, we should add a new one).

The thing is that you can't assume your pager is the only one representing the layout. For instance, when you move to another workspace in metacity (with the keybindings), you can see the layout there too.
Comment 4 Andrzej 2011-11-25 15:48:52 UTC
(In reply to comment #3)
> Yes, we need to change the WnckScreen API (actually, to stay API compatible,
> we should add a new one).

OK.

> The thing is that you can't assume your pager is the only one representing the
> layout. For instance, when you move to another workspace in metacity (with the
> keybindings), you can see the layout there too.

My goal is to rotate the pager 90 deg to the left or right without affecting the number of rows/columns of workspaces. This is because all other plugins in the panel, and the panel itself, will be rotated as well. This creates a strong perception that within the panel everything (including the pager) is rotated.

To illustrate that, I'm trying to implement these three modes:

- a horizontal pager (in either horizontal or vertical panel):
1 2 3
4 5 6

- a pager rotated to the left (only in a vertical panel):
3 6
2 5
1 4

- a pager rotated to the right (only in a vertical panel):
4 1
5 2
6 3

OTOH if we rotate the workspace space as well we cancel out the effect of having vertical orientation in the pager. 

If I understand you correctly, that would yield something like this:
1 2
3 4
5 6

That could be useful indeed but this mode is already easily achievable with the existing API by just sticking to the horizontal orientation and changing the number of rows/columns.
Comment 5 Andrzej 2011-11-26 14:03:04 UTC
Vincent, I've been looking into "screen" and "xutils" and I'm not sure if I get the full picture of the problem and if I can subsequently test it properly.

My current plan is to:

- (in "screen") add:

int wnck_screen_try_set_workspace_orientation (WnckScreen             *screen,
                                               int                     current_token,
                                               _WnckLayoutOrientation *orientation);
int wnck_screen_try_set_workspace_corner (WnckScreen        *screen,
                                          int                current_token,
                                          _WnckLayoutCorner *starting_corner);

- (in "xutils") obsolete:

void _wnck_set_desktop_layout (Screen *xscreen,
                               int     rows,
                               int     columns);

  and add:

void _wnck_set_desktop_layout_all (Screen                 *xscreen,
                                   _WnckLayoutOrientation *orientation);
                                   int                     rows,
                                   int                     columns,
                                   _WnckLayoutCorner      *starting_corner);

The logic seems fairly simple, the changes are mostly about the API. I may go ahead and implement it but I wouldn't be surprised if I was missing something important in your code.

---

I feel more confident doing the "pager" part of this work, at least I can test it reasonably well.

Also, do I understand correctly that the "pager" API and the "screen" API are independent from each other? That is, calling wnck_pager_set_starting_corner() is not required to call wnck_screen_try_set_workspace_corner()? If so, then please ignore my comment #4 - I'm perfectly happy with this solution.
Comment 6 Andrzej 2011-11-26 15:09:33 UTC
Created attachment 202183 [details] [review]
Added screen (and xutils) API for setting starting corner and orientation

Patch against rev. 2.30.8. Added screen (and xutils) API for setting starting corner and orientation. Compiles and new procedures don't crash when called. Unable to verify the functional correctness.

This patch does not modify pager API (t.b.d.).
Comment 7 Andrzej 2011-11-26 19:04:26 UTC
Created attachment 202202 [details] [review]
 pager: added support for changing starting corner.

This is the second part of the patch (the one for the pager). It works for me but with a very poor test coverage and some problems.
In particular, the code does not change the underlying screen (for an unknown reason), not even the number of rows/columns, which worked before.

Now, (as I explained in comment #4) I actually strongly prefer the pager not to change the screen settings, at least for the rotation. The fact that this particular pager is rotated has nothing to do with the screen - there might be other pagers or WM that are not rotated or rotated in different directions.

How about removing this automatic connection? The API for the screen rotation is now available so the user can always rotate the screen manually, if he/she wishes so.
Comment 8 Andrzej 2011-11-26 20:25:58 UTC
Created attachment 202204 [details] [review]
screen: bugfix (pager changes are now propagated to the screen)

screen: bugfix (pager changes are now propagated to the screen)
Comment 9 Andrzej 2011-11-27 06:44:50 UTC
Created attachment 202222 [details] [review]
pager: workspace ordering fix in horizontal mode

Fixing a mistake in the workspace ordering in the horizontal mode.
Comment 10 Andrzej 2011-11-27 07:16:36 UTC
Vincent, I having problem making multiple pagers work. That is:

1. To update their own layout when the screen settings change (e.g. number of rows)
2. Respect their own settings. E.g. if a secondary pager is added and the user chooses to rotate it, nothing happens. I'd like this pager only to rotate w.r.t. the screen (that is taking the current screen layout as a reference).

None of this currently happens, although with above patches a single "master" pager seems to work correctly.

Note: I'm now OK with the concept of a "master pager". That is the one, which has the power to tweak screen settings. The question is about handling "secondary" views such as other pagers or the WM.
Comment 11 GNOME Infrastructure Team 2018-01-24 13:51:11 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/124.