Merge lp:~alan-griffiths/miral/fix-1602331 into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Andreas Pokorny
Approved revision: 224
Merged at revision: 224
Proposed branch: lp:~alan-griffiths/miral/fix-1602331
Merge into: lp:miral
Diff against target: 24 lines (+8/-2)
1 file modified
miral/basic_window_manager.cpp (+8/-2)
To merge this branch: bzr merge lp:~alan-griffiths/miral/fix-1602331
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
Review via email: mp+299840@code.launchpad.net

Commit message

Don't assume that hidden windows don't move - i.e. "restore" them where they are.

Description of the change

Don't assume that hidden windows don't move - i.e. "restore" them where they are.

The most obvious issue is with menus that are hidden ans restored by toolkits (see linked bug report).

To post a comment you must log in.
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Hm is window and window_info diverging here?

This code looks strange. If miral updates the position of hidden windows, why would you have to restore anything here?

review: Needs Information
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Ok this would work fine with the upcoming gtk+ ..

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Hm is window and window_info diverging here?

I don't understand the question. window_info is metadata needed by WM about the window being managed. They have different, but related, roles.

> This code looks strange. If miral updates the position of hidden windows, why
> would you have to restore anything here?

We have a state transition from "hidden" to (in the bug case) "restored".

It is simpler to set restore_rect when exiting "hidden" than add a special case when entering "restore" to see whether the old state was "hidden" and ignore restore_rect.

(IMO It also makes more sense if there's a transition to another state - although I suspect there's additional work required to get the right logic in all cases (e.g. where windows are resized when vertically/horizontally maximized).)

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Ok understood now..

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'miral/basic_window_manager.cpp'
2--- miral/basic_window_manager.cpp 2016-07-11 15:57:49 +0000
3+++ miral/basic_window_manager.cpp 2016-07-12 16:30:04 +0000
4@@ -669,12 +669,18 @@
5 return;
6 }
7
8- if (window_info.state() == mir_surface_state_restored)
9+ switch (window_info.state())
10 {
11+ case mir_surface_state_restored:
12+ case mir_surface_state_hidden:
13 window_info.restore_rect({window_info.window().top_left(), window_info.window().size()});
14+ break;
15+
16+ default:
17+ break;
18 }
19
20- if (window_info.state() != mir_surface_state_fullscreen)
21+ if (value != mir_surface_state_fullscreen)
22 {
23 window_info.output_id({});
24 fullscreen_surfaces.erase(window_info.window());

Subscribers

People subscribed via source and target branches