Merge lp://qastaging/~3v1n0/unity/lim-panel into lp://qastaging/unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merge reported by: Marco Trevisan (Treviño)
Merged at revision: not available
Proposed branch: lp://qastaging/~3v1n0/unity/lim-panel
Merge into: lp://qastaging/unity
Prerequisite: lp://qastaging/~3v1n0/unity/lim
Diff against target: 1212 lines (+729/-37)
14 files modified
UnityCore/AppmenuIndicator.cpp (+47/-5)
UnityCore/AppmenuIndicator.h (+17/-3)
plugins/unityshell/src/PanelIndicatorAppmenuView.cpp (+238/-0)
plugins/unityshell/src/PanelIndicatorAppmenuView.h (+68/-0)
plugins/unityshell/src/PanelIndicatorEntryView.cpp (+25/-6)
plugins/unityshell/src/PanelIndicatorEntryView.h (+1/-0)
plugins/unityshell/src/PanelIndicatorsView.cpp (+11/-0)
plugins/unityshell/src/PanelIndicatorsView.h (+2/-0)
plugins/unityshell/src/PanelMenuView.cpp (+240/-20)
plugins/unityshell/src/PanelMenuView.h (+9/-0)
plugins/unityshell/src/PanelStyle.cpp (+1/-0)
plugins/unityshell/src/PanelStyle.h (+1/-0)
plugins/unityshell/src/unityshell.cpp (+3/-2)
tests/test_indicator_appmenu.cpp (+66/-1)
To merge this branch: bzr merge lp://qastaging/~3v1n0/unity/lim-panel
Reviewer Review Type Date Requested Status
Sam Spilsbury Pending
Review via email: mp+92710@code.qastaging.launchpad.net

Description of the change

UI work for the Locally Integrated Menus support for the unity panel.

I've made some code improvements and rewrite to PanelStyle, PanelMenuView, PanelIndicatorEntryView, PanelTitlebarGrabArea and WindowButtons, plus I've added the new class PanelIndicatorAppmenuView which is a special indicator that is created when the PanelMenu is in the "integrated-mode". In that case the appmenu view is populated with the indicator entry (that won't ever change) and updated against the window status changes to match the content of the currently maximized window on top of the stack.

Using the integrated menu, the appmenu-indicator is also capable of being dragged down, middle-clicked and double-clicked exactly like the PanelTitlebarGrabArea. When clicking on it, if the mouse-up event happens after 120ms the mouse-down, we just consider that action as a grab and we start acting accordingly.

Updated 17/02:
Fixed also bug #934680, added some new features to WindowManager, some of them imported from lp:~3v1n0/unity/super-arrows-shortcuts:

GetWindowSavedGeometry: returns the window saved geometry, that it doesn't
                        consider if the window is maximized or not.
MoveResizeWindow: the name should say what it does ;)
GetWorkAreaGeometry: returns the size of the work-area for the given
                     window of for the current output (if xid = 0),
                     It considers the struts geometries.
RestoreAt: restores a window and move it at the given x, y position
           keeping the standard geometry.

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

8 +BuilderWrapper& BuilderWrapper::add(char const* name, long int value)
9 +{
10 + g_variant_builder_add(builder_, "{sv}", name, g_variant_new_int64(value));

long is 32-bit on i386, if you really need 64bit value this should be changed to "long long".

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> 8 +BuilderWrapper& BuilderWrapper::add(char const* name, long int value)
> 9 +{
> 10 + g_variant_builder_add(builder_, "{sv}", name,
> g_variant_new_int64(value));
>
> long is 32-bit on i386, if you really need 64bit value this should be changed
> to "long long".

Right. I've added wrappers for long long too, anyway I'm keeping the variant as a gint64 also for long int, to make sure it's working also on 64bit...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

"The diff has been truncated for viewing. "

Try to avoid doing too much rewriting in any one branch :)

466 PanelIndicatorEntryView::~PanelIndicatorEntryView()
467 {
468 - on_indicator_activate_changed_connection_.disconnect();
469 - on_indicator_updated_connection_.disconnect();
470 - on_panelstyle_changed_connection_.disconnect();
471 - g_signal_handler_disconnect(gtk_settings_get_default(), on_font_changed_connection_);
472 - if (texture_layer_)
473 - delete texture_layer_;
474 + // Nothing to do...
475 }

The empty destructor's definition can be removed (unless its virtual)

+ if (!wm->IsExpoActive() && !wm->IsScaleActive())
490 + {

This probably doesn't make sense living where it is. The Panel views should block all clicks if if the screen is grabbed by compiz period (eg, add a wrapper method in WindowManager around CompScreen::otherGrabExist (NULL);)

3181 + /* FIXME, this can be removed when window_unmapped WindowManager signal
3182 + * will emit the proper xid */
3183 + Window xid = bamf_window_get_xid(reinterpret_cast<BamfWindow*>(view));
3184 + OnWindowUnmapped(xid);

Can you explain this? It could be emitting the frame xid, and that needs to be fixed there :)

nvm found it

3391 + // FIXME: compiz doesn't give us a valid xid (is always 0 on unmap)
3392 + // we need to do this again on BamfView closed signal.

Great. I'll fix that in compiz then. (This is probably the case when the window is destroyed and the xid is changed to zero, and then the unmap signal happens)

The window management stuff looks great.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> "The diff has been truncated for viewing. "
>
> Try to avoid doing too much rewriting in any one branch :)

Yes, I know, but things often come in mind when doing it, and as I'm touching a lot of panel stuff, I'd prefer to keep all here.
You can just use bzr send lp:unity -o branch-changes.diff to check them locally ;)

> The empty destructor's definition can be removed (unless its virtual)
>
> + if (!wm->IsExpoActive() && !wm->IsScaleActive())
> 490 + {
>
> This probably doesn't make sense living where it is. The Panel views should
> block all clicks if if the screen is grabbed by compiz period (eg, add a
> wrapper method in WindowManager around CompScreen::otherGrabExist (NULL);)

Well, if the dash grab isn't considered by that, I could try to do it.

> 3391 + // FIXME: compiz doesn't give us a valid xid (is always 0 on unmap)
> 3392 + // we need to do this again on BamfView closed signal.
>
> Great. I'll fix that in compiz then. (This is probably the case when the
> window is destroyed and the xid is changed to zero, and then the unmap signal
> happens)

Let me know when your fix will be landed, so we can remove this.

> The window management stuff looks great.

Cool! ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.