Mercurial > pidgin.yaz
comparison plugins/docklet/docklet-win32.c @ 12016:24c7fb94d3a3
[gaim-migrate @ 14309]
Patch from charkins to fix potential problems with the buddy list becoming invisible with no way to restore visiblity. This (re)introduces the concept of a "visibility manager" that, if present, will be in charge of controlling the visibility of the buddy list.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Wed, 09 Nov 2005 02:25:26 +0000 |
parents | cae2fb7e8594 |
children | 011efeb86b8d |
comparison
equal
deleted
inserted
replaced
12015:5a63ea24ac83 | 12016:24c7fb94d3a3 |
---|---|
188 | 188 |
189 static void wgaim_tray_blank_icon() { | 189 static void wgaim_tray_blank_icon() { |
190 systray_change_icon(sysicon_blank, NULL); | 190 systray_change_icon(sysicon_blank, NULL); |
191 } | 191 } |
192 | 192 |
193 void wgaim_tray_minimize(GaimGtkBuddyList *gtkblist) { | |
194 MinimizeWndToTray(GDK_WINDOW_HWND(gtkblist->window->window)); | |
195 } | |
196 | |
197 void wgaim_tray_maximize(GaimGtkBuddyList *gtkblist) { | |
198 RestoreWndFromTray(GDK_WINDOW_HWND(gtkblist->window->window)); | |
199 } | |
200 | |
201 | |
193 static void wgaim_tray_create() { | 202 static void wgaim_tray_create() { |
194 OSVERSIONINFO osinfo; | 203 OSVERSIONINFO osinfo; |
195 /* dummy window to process systray messages */ | 204 /* dummy window to process systray messages */ |
196 systray_hwnd = systray_create_hiddenwin(); | 205 systray_hwnd = systray_create_hiddenwin(); |
197 | 206 |
218 } | 227 } |
219 sysicon_blank = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); | 228 sysicon_blank = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); |
220 | 229 |
221 /* Create icon in systray */ | 230 /* Create icon in systray */ |
222 systray_init_icon(systray_hwnd, sysicon_disconn); | 231 systray_init_icon(systray_hwnd, sysicon_disconn); |
232 | |
233 gaim_signal_connect(gaim_gtk_blist_get_handle(), "gtkblist-hiding", | |
234 &handle, GAIM_CALLBACK(wgaim_tray_minimize), NULL); | |
235 gaim_signal_connect(gaim_gtk_blist_get_handle(), "gtkblist-unhiding", | |
236 &handle, GAIM_CALLBACK(wgaim_tray_maximize), NULL); | |
237 | |
223 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "created\n"); | 238 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "created\n"); |
224 } | 239 } |
225 | 240 |
226 static void wgaim_tray_destroy() { | 241 static void wgaim_tray_destroy() { |
242 gaim_signals_disconnect_by_handle(&handle); | |
227 systray_remove_nid(); | 243 systray_remove_nid(); |
228 DestroyWindow(systray_hwnd); | 244 DestroyWindow(systray_hwnd); |
229 docklet_remove(TRUE); | 245 docklet_remove(TRUE); |
230 } | |
231 | |
232 void wgaim_tray_minimize(GtkWidget *window) { | |
233 MinimizeWndToTray(GDK_WINDOW_HWND(window->window)); | |
234 } | |
235 | |
236 void wgaim_tray_maximize(GtkWidget *window) { | |
237 RestoreWndFromTray(GDK_WINDOW_HWND(window->window)); | |
238 } | 246 } |
239 | 247 |
240 static struct docklet_ui_ops wgaim_tray_ops = | 248 static struct docklet_ui_ops wgaim_tray_ops = |
241 { | 249 { |
242 wgaim_tray_create, | 250 wgaim_tray_create, |
243 wgaim_tray_destroy, | 251 wgaim_tray_destroy, |
244 wgaim_tray_update_icon, | 252 wgaim_tray_update_icon, |
245 wgaim_tray_blank_icon, | 253 wgaim_tray_blank_icon, |
246 wgaim_tray_minimize, | |
247 wgaim_tray_maximize, | |
248 NULL | 254 NULL |
249 }; | 255 }; |
250 | 256 |
251 /* Used by docklet's plugin load func */ | 257 /* Used by docklet's plugin load func */ |
252 void docklet_ui_init() { | 258 void docklet_ui_init() { |