summaryrefslogtreecommitdiff
path: root/unity-private
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2010-08-21 12:59:37 +0100
committerNeil Jagdish Patel <neil.patel@canonical.com>2010-08-21 12:59:37 +0100
commit5992cb37b2a51f7fa5c6821ba20e4a982a8f5a26 (patch)
tree6aad69a441f07dcdd06ef3b114bb569f59d8e0bc /unity-private
parent38e9735182abbfce723722c38ffafb3e93985906 (diff)
- Correctly hide the window controls if the current bamf view is destroyed
Fixes LP: #613087 (bzr r451.1.3)
Diffstat (limited to 'unity-private')
-rw-r--r--unity-private/panel/panel-window-buttons.vala30
1 files changed, 30 insertions, 0 deletions
diff --git a/unity-private/panel/panel-window-buttons.vala b/unity-private/panel/panel-window-buttons.vala
index 0f399409d..4a9dd0996 100644
--- a/unity-private/panel/panel-window-buttons.vala
+++ b/unity-private/panel/panel-window-buttons.vala
@@ -32,6 +32,8 @@ namespace Unity.Panel
private uint32 last_xid = 0;
+ private unowned Bamf.View _last_view = null;
+
public WindowButtons ()
{
Object (orientation:Ctk.Orientation.HORIZONTAL,
@@ -103,6 +105,14 @@ namespace Unity.Panel
minimize.hide ();
unmaximize.hide ();
last_xid = 0;
+
+ if (object is Bamf.View)
+ {
+ if (object == _last_view)
+ {
+ object.weak_unref (on_last_view_destroyed);
+ }
+ }
if (new_view is Bamf.Window)
{
@@ -152,6 +162,26 @@ namespace Unity.Panel
{
appname.set_markup (FORMAT.printf (win.get_name ()));
}
+
+ _last_view = new_view;
+ _last_view.weak_ref (on_last_view_destroyed);
+ }
+ else
+ {
+ _last_view = null;
+ }
+ }
+
+ private void on_last_view_destroyed (Object object)
+ {
+ if (object == _last_view)
+ {
+ _last_view = null;
+ appname.set_markup ("");
+ appname.hide ();
+ close.hide ();
+ minimize.hide ();
+ unmaximize.hide ();
}
}