Merge lp:~alan-griffiths/miral/rework-handling-of-surface-state-changes into lp:miral
| Status: | Merged |
|---|---|
| Approved by: | Gerry Boland on 2016-09-30 |
| Approved revision: | 384 |
| Merged at revision: | 375 |
| Proposed branch: | lp:~alan-griffiths/miral/rework-handling-of-surface-state-changes |
| Merge into: | lp:miral |
| Diff against target: |
425 lines (+137/-81) 11 files modified
debian/libmiral1.symbols (+1/-0) include/miral/window_manager_tools.h (+2/-0) miral-shell/titlebar_window_manager.cpp (+1/-1) miral/basic_window_manager.cpp (+114/-78) miral/basic_window_manager.h (+2/-1) miral/set_window_managment_policy.cpp (+1/-1) miral/symbols.map (+1/-0) miral/window_management_trace.cpp (+8/-0) miral/window_management_trace.h (+1/-0) miral/window_manager_tools.cpp (+4/-0) miral/window_manager_tools_implementation.h (+2/-0) |
| To merge this branch: | bzr merge lp:~alan-griffiths/miral/rework-handling-of-surface-state-changes |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gerry Boland | Approve on 2016-09-30 | ||
| Daniel d'Andrada (community) | test | 2016-09-29 | Approve on 2016-09-29 |
|
Review via email:
|
|||
Commit Message
Rework the handling of surface state changes:
1. shells now have the option of ignoring (or adjusting) the default placement.
2. fixes issues arising when the state of the active window changes.
Description of the Change
Rework the handling of surface state changes:
1. shells now have the option of ignoring (or adjusting) the default placement.
2. fixes issues arising when the state of the active window changes.
It may seem odd to provide position_
| Gerry Boland (gerboland) wrote : | # |
+ void position_
name doesn't quite match implementation, as it also impacts size, perhaps "geometry_
| Gerry Boland (gerboland) wrote : | # |
+void miral::
+ void position_
Order of the arguments now do not match. Consistency would be nice. I'm unsure why you changed the first one here.
| Gerry Boland (gerboland) wrote : | # |
- policy-
- window_
- mir_surface-
- mir_surface-
- if (window_
- {
- mru_active_
-
- // Try to activate to recently active window of any application
- mru_active_
- {
- auto const w = window;
- return !(select_
- });
- }
- return;
I wasn't expecting this to vanish in this MP. Is it dead code?
| Gerry Boland (gerboland) wrote : | # |
> +void
> miral::
> const& modifications, WindowInfo const& window_info) const
>
> + void position_
> const& window_info) const override;
>
> Order of the arguments now do not match. Consistency would be nice. I'm unsure
> why you changed the first one here.
Or the consistency you're developing is an (out, const in) design?
| Alan Griffiths (alan-griffiths) wrote : | # |
> - policy-
> - window_
> - mir_surface-
> - mir_surface-
> - if (window_
> - {
> - mru_active_
> -
> - // Try to activate to recently active window of any application
> - mru_active_
> - {
> - auto const w = window;
> - return !(select_
> - });
> - }
> - return;
>
> I wasn't expecting this to vanish in this MP. Is it dead code?
Neither.
+ if (window == active_window())
+ {
+ // Try to activate to recently active window of any application
+ mru_active_
+ {
+ if (candidate == window)
+ return true;
+ auto const w = candidate;
+ return !(select_
+ });
+ }
Plus some duplicated code consolidated.
- 384. By Alan Griffiths on 2016-09-29
-
position_
for_state( ) => place_and_ size_for_ state()
| Alan Griffiths (alan-griffiths) wrote : | # |
> > +void
> > miral::
> > const& modifications, WindowInfo const& window_info) const
> >
> > + void position_
> > const& window_info) const override;
> >
> > Order of the arguments now do not match. Consistency would be nice. I'm
> unsure
> > why you changed the first one here.
>
> Or the consistency you're developing is an (out, const in) design?
Partly that, but also both functions are /about/ the first parameter, with the second parameter being secondary.
| Alan Griffiths (alan-griffiths) wrote : | # |
> + void position_
> const& window_info) const;
> name doesn't quite match implementation, as it also impacts size, perhaps
> "geometry_
place_and_
| Gerry Boland (gerboland) wrote : | # |
> > + void position_
> > const& window_info) const;
> > name doesn't quite match implementation, as it also impacts size, perhaps
> > "geometry_
>
> place_and_
You use similar elsewhere, so yeah.

Fixes those two bugs I reported, so I'm happy with it.
No opinion on the code itself, just stating that it fixed those bugs.