~ubuntu-branches/ubuntu/oneiric/docky/oneiric

« back to all changes in this revision

Viewing changes to Docky/Docky/Interface/HoverTextManager.cs

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2010-07-01 21:21:50 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100701212150-1dqehqxey8rrvtlo
Tags: 2.0.5-1
* New upstream release 2.0.5 "Be proud of your dock",
  changes include:
  + remove --debug flag from launcher for lower memory usage
  + update the about dialog credits to list documenters and make translation 
    tab easier to read
  + change url in about dialog to the launchpad project page
  + Window-Matching
    - fix for applications commandline
    - properly match qt creator (LP: #594814)
    - prefer local over global launchers (LP: #588073) (LP: #592841)
    - match prefix for gksudo (LP: #516433)
    - fix nautilus items showing active indicator when desktop 
      is focused (LP: #487113)
    - fix matching wine apps that use a prefixed launcher (LP: #596092)
  + Memory Leaks
    - dispose of calendar painter when the clock item is disposed
    - fix leak in AutoHideManager
    - several fixes using Cairo.Context.Target and Pango.Layout
    - fix leak in PagingPainters
    - fix leak in recursive file-deletion
    - fix leaking SeparatorItems, WnckDockItems
    - fix leaks with FileEmblems
    - fix Pixbuf related leaks
    - fix some leaks regarding FileMonitors
    - fix leaks regarding Tiles and AbtractTileObjects
    - fix leaking Glib.FileAdapter caused by unreferenced Action in 
      FileDockItem
  + Handle invalid desktopfile entry and UriFormatException in 
    FileApplicationProvider (LP: #595921)
  + fix potential crash for invalid HelperMetadata
  + handle drops correctly
  + fix handling of Helpers in HelperService
  + make the sliders in preferences behave better
  + fix drawing of rotated items
  + fix HoveredItem click-position
  + avoids fatal errors on console when loading embedded icons when no 
    height or width is specified and when dock items have a null Icon
  + fix icon theme change not refreshing the dock icons (LP: #590205)
  + fix SVG rendering bug
  + fix iconsize temporarily getting large when adding to full dock 
    (LP: #579576)
  + fix the 'crash in PinToDock' (LP: #588073)
  + make 3d background height more consistent and a tad larger (LP: #503038)
  + fix dragging multiple files to a folder on the dock, which caused 
    a crash and data corruption (LP: #579049)
  + don't request animations if urgent state is removed from a window and 
    fix glow location (LP: #596422)
  + fix window previews being offset (LP: #495065)
  + fix broken zoom after shrinking icon size (LP: #598924)
  + fix problem with hovers still visible when painters show
  + fix displaying default icon in place of missing file emblem (LP: #534651)
  + fix crash when gconf key for menus_have_icons is not set (LP: #573751)
  + make sure painters fit on screen (LP: #589978)
  + fix icon minimize animations not working immediately for some newly 
    opened windows
  + don't dispose our static DockyItem
  + fix CurrentDesktopOnly not working when dragging a window across desktops
    (LP: #600290)
  + GMail: 
    - fix thread-guards and remove deprecated code
    - fix problem with feeds that don't have an author entry (LP: #595530)
  + NPR: fix bug where removing your last NPR station unloaded the docklet
    and fix station icon
  + NetworkManager: fix crash caused when NM goes away
    and fix icons and add another fallback icon (LP: #588581)
  + Mounter:
    - fixed some leaks
    - only remove mounted items if they were successfully unmounted 
      (LP: #597637)
    - fix duplicate icons showing in mounter (LP: #525306)
  + Weather: fix feels like temp showing incorrect for metric (LP: #597670)
  + RecentDocuments: 
    - fixed some leaks
    - fix sensitivity of recent docs clear menu item - even if docky shows 
      the list as empty does not mean it cant be cleared
* debian/patches/01_use_cli_for_wrapper.patch:
  + patch wrapper script to meet the Debian CLI Policy
* debian/control:
  + Bump Standards version to 3.9.0 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//  
2
2
//  Copyright (C) 2009 Jason Smith, Robert Dyer
 
3
//  Copyright (C) 2010 Robert Dyer, Rico Tzschichholz
3
4
// 
4
5
//  This program is free software: you can redistribute it and/or modify
5
6
//  it under the terms of the GNU General Public License as published by
32
33
 
33
34
namespace Docky.Interface
34
35
{
35
 
 
36
36
        public class HoverTextManager : IDisposable
37
37
        {
38
38
                public DockPosition Gravity { get; set; }
39
 
                public bool Visible { get; private set; }
 
39
                
 
40
                public bool Visible { 
 
41
                        get { return window != null && window.Visible; }
 
42
                }
40
43
                
41
44
                Gtk.Window window;
42
45
                Gdk.Point currentPoint;
43
46
                DockySurface currentSurface;
44
 
                uint timer;
45
47
                
46
48
                static DockySurface [] slices;
47
49
                DockySurface background_buffer;
81
83
                void DockyControllerThemeChanged (object sender, EventArgs e)
82
84
                {
83
85
                        if (slices != null) {
84
 
                                foreach (DockySurface s in slices) {
 
86
                                foreach (DockySurface s in slices)
85
87
                                        s.Dispose ();
86
 
                                }
87
88
                                slices = null;
88
89
                        }
89
90
                        ResetBackgroundBuffer ();
102
103
                        currentPoint = point;
103
104
                        
104
105
                        if (surface == null) {
105
 
                                window.Hide ();
 
106
                                Hide ();
106
107
                                return;
107
108
                        }
108
109
                        
125
126
                                break;
126
127
                        }
127
128
                        
128
 
                        if (timer > 0)
129
 
                                GLib.Source.Remove (timer);
130
 
                        
131
129
                        Gdk.Rectangle monitor_geo = window.Screen.GetMonitorGeometry (Monitor);
132
130
                        center.X = Math.Max (monitor_geo.X, Math.Min (center.X, monitor_geo.X + monitor_geo.Width - surface.Width));
133
131
                        center.Y = Math.Max (monitor_geo.Y, Math.Min (center.Y, monitor_geo.Y + monitor_geo.Height - surface.Height));
134
132
                        
135
 
                        window.QueueDraw ();
 
133
                        if (Visible)
 
134
                                window.QueueDraw ();
136
135
                        window.Move (center.X, center.Y);
137
 
                        timer = GLib.Timeout.Add (100, delegate {
138
 
                                window.QueueDraw ();
139
 
                                window.Move (center.X, center.Y);
140
 
                                timer = 0;
141
 
                                return false;
142
 
                        });
143
 
                        
144
 
                        if (Visible)
145
 
                                window.Show ();
146
136
                }
147
137
 
148
138
                void HandleWindowExposeEvent (object o, ExposeEventArgs args)
165
155
                                }
166
156
                                
167
157
                                cr.Paint ();
 
158
 
 
159
                                (cr.Target as IDisposable).Dispose ();
168
160
                        }
169
161
                }
170
162
                
171
163
                public void Show ()
172
164
                {
173
 
                        Visible = true;
174
 
                        if (currentSurface != null)
 
165
                        if (currentSurface != null && window != null && !window.Visible)
175
166
                                window.Show ();
176
167
                }
177
168
                
178
169
                public void Hide ()
179
170
                {
180
 
                        Visible = false;
181
 
                        if (window != null)
 
171
                        if (Visible)
182
172
                                window.Hide ();
183
173
                }
184
174
                
235
225
                                window = null;
236
226
                        }
237
227
                        if (slices != null) {
238
 
                                foreach (DockySurface s in slices) {
 
228
                                foreach (DockySurface s in slices)
239
229
                                        s.Dispose ();
240
 
                                }
241
230
                                slices = null;
242
231
                        }
243
232
                        ResetBackgroundBuffer ();