Mir

Merge lp:~alan-griffiths/mir/layout-freestyle-windows-correctly into lp:mir

Proposed by Alan Griffiths on 2017-09-25
Status: Merged
Merged at revision: 4271
Proposed branch: lp:~alan-griffiths/mir/layout-freestyle-windows-correctly
Merge into: lp:mir
Diff against target: 36 lines (+13/-9)
1 file modified
examples/miral-shell/floating_window_manager.cpp (+13/-9)
To merge this branch: bzr merge lp:~alan-griffiths/mir/layout-freestyle-windows-correctly
Reviewer Review Type Date Requested Status
Chris Halse Rogers 2017-09-25 Approve on 2017-09-26
Mir CI Bot continuous-integration Approve on 2017-09-26
Review via email: mp+331293@code.launchpad.net

Commit message

[miral-kiosk] correct "floating" layout rules for freestyle surfaces

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4265
https://mir-jenkins.ubuntu.com/job/mir-ci/3688/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5056
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5292
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5280
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5280
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5280
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5100/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5100
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5100/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3688/rebuild

review: Approve (continuous-integration)
Chris Halse Rogers (raof) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/miral-shell/floating_window_manager.cpp'
2--- examples/miral-shell/floating_window_manager.cpp 2017-08-21 15:58:34 +0000
3+++ examples/miral-shell/floating_window_manager.cpp 2017-09-25 19:58:03 +0000
4@@ -677,20 +677,24 @@
5 }
6
7 auto FloatingWindowManagerPolicy::confirm_placement_on_display(
8- miral::WindowInfo const& /*window_info*/, MirWindowState new_state, Rectangle const& new_placement) -> Rectangle
9+ miral::WindowInfo const& window_info, MirWindowState new_state, Rectangle const& new_placement) -> Rectangle
10 {
11 switch (new_state)
12 {
13+ case mir_window_state_maximized:
14+ case mir_window_state_vertmaximized:
15+ if (window_info.needs_titlebar(window_info.type()))
16+ {
17+ auto result = new_placement;
18+
19+ result.top_left.y = result.top_left.y + title_bar_height;
20+ result.size.height = result.size.height - title_bar_height;
21+ return result;
22+ }
23+ // else
24+ // Falls through.
25 default:
26 return new_placement;
27-
28- case mir_window_state_maximized:
29- case mir_window_state_vertmaximized:
30- auto result = new_placement;
31-
32- result.top_left.y = result.top_left.y + title_bar_height;
33- result.size.height = result.size.height - title_bar_height;
34- return result;
35 }
36 }
37

Subscribers

People subscribed via source and target branches