Mercurial > pidgin.yaz
comparison pidgin/plugins/win32/winprefs/gtkappbar.c @ 20769:712020cd7c8e
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 04 Oct 2007 01:25:43 +0000 |
parents | 44b4e8bd759b |
children | 8998ca47e6d0 |
comparison
equal
deleted
inserted
replaced
20768:48ee7ec3426d | 20769:712020cd7c8e |
---|---|
350 | 350 |
351 SHAppBarMessage(ABM_ACTIVATE, &abd); | 351 SHAppBarMessage(ABM_ACTIVATE, &abd); |
352 } | 352 } |
353 return GDK_FILTER_CONTINUE; | 353 return GDK_FILTER_CONTINUE; |
354 } | 354 } |
355 | |
356 static void show_hide(GtkAppBar *ab, gboolean hide) { | |
357 purple_debug_info("gtkappbar", "show_hide(%d)\n", hide); | |
358 | |
359 if (hide) { | |
360 purple_debug_info("gtkappbar", "hidden\n"); | |
361 gtk_appbar_unregister(ab, GDK_WINDOW_HWND(ab->win->window)); | |
362 ab->docked = TRUE; | |
363 ab->iconized = TRUE; | |
364 } else { | |
365 ab->iconized = FALSE; | |
366 purple_debug_info("gtkappbar", "shown\n"); | |
367 ab->docked = FALSE; | |
368 gtk_appbar_do_dock(ab, ab->side); | |
369 } | |
370 | |
371 } | |
372 | |
355 /** Notify the system that the appbar's position has changed */ | 373 /** Notify the system that the appbar's position has changed */ |
356 static GdkFilterReturn wnd_poschanged(GtkAppBar *ab, GdkXEvent *xevent) { | 374 static GdkFilterReturn wnd_poschanged(GtkAppBar *ab, GdkXEvent *xevent) { |
357 if (ab->registered) { | 375 if (ab->registered) { |
358 APPBARDATA abd; | 376 APPBARDATA abd; |
359 MSG *msg = (MSG*)xevent; | 377 MSG *msg = (MSG*)xevent; |
378 | |
360 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_poschanged\n"); | 379 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_poschanged\n"); |
361 | 380 |
362 abd.hWnd = msg->hwnd; | 381 abd.hWnd = msg->hwnd; |
363 abd.cbSize = sizeof(APPBARDATA); | 382 abd.cbSize = sizeof(APPBARDATA); |
364 | 383 |
365 SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd); | 384 SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd); |
385 | |
366 } | 386 } |
367 return GDK_FILTER_CONTINUE; | 387 return GDK_FILTER_CONTINUE; |
368 } | 388 } |
369 /** The window is about to change */ | 389 /** The window is about to change */ |
370 static GdkFilterReturn wnd_poschanging(GtkAppBar *ab, GdkXEvent *xevent) { | 390 static GdkFilterReturn wnd_poschanging(GtkAppBar *ab, GdkXEvent *xevent) { |
380 wpos->cy = ab->docked_rect.bottom - ab->docked_rect.top; | 400 wpos->cy = ab->docked_rect.bottom - ab->docked_rect.top; |
381 if(IsIconic(msg->hwnd)) | 401 if(IsIconic(msg->hwnd)) |
382 set_toolbar(msg->hwnd, FALSE); | 402 set_toolbar(msg->hwnd, FALSE); |
383 /*return GDK_FILTER_REMOVE;*/ | 403 /*return GDK_FILTER_REMOVE;*/ |
384 } | 404 } |
405 | |
406 if (ab->docked) { | |
407 if (ab->iconized && wpos->flags & SWP_SHOWWINDOW) | |
408 show_hide(ab, FALSE); | |
409 else if (!ab->iconized && wpos->flags & SWP_HIDEWINDOW) | |
410 show_hide(ab, TRUE); | |
411 } | |
412 | |
385 return GDK_FILTER_CONTINUE; | 413 return GDK_FILTER_CONTINUE; |
386 } | 414 } |
387 | 415 |
388 static GdkFilterReturn wnd_exitsizemove(GtkAppBar *ab, GdkXEvent *xevent) { | 416 static GdkFilterReturn wnd_exitsizemove(GtkAppBar *ab, GdkXEvent *xevent) { |
389 MSG *msg = (MSG*)xevent; | 417 MSG *msg = (MSG*)xevent; |
407 | 435 |
408 return GDK_FILTER_CONTINUE; | 436 return GDK_FILTER_CONTINUE; |
409 } | 437 } |
410 | 438 |
411 static GdkFilterReturn wnd_showwindow(GtkAppBar *ab, GdkXEvent *xevent) { | 439 static GdkFilterReturn wnd_showwindow(GtkAppBar *ab, GdkXEvent *xevent) { |
412 MSG *msg = (MSG*)xevent; | 440 MSG *msg = (MSG*)xevent; |
413 | 441 |
414 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_showwindow\n"); | 442 purple_debug_info("gtkappbar", "wnd_showwindow\n"); |
415 if(msg->wParam && ab->docked) { | 443 if(msg->wParam && ab->docked) { |
416 ab->iconized = FALSE; | 444 show_hide(ab, FALSE); |
417 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "shown\n"); | 445 } else if(!msg->wParam && ab->docked) { |
418 ab->docked = FALSE; | 446 show_hide(ab, TRUE); |
419 gtk_appbar_do_dock(ab, ab->side); | 447 } |
420 } | 448 return GDK_FILTER_CONTINUE; |
421 else if(!msg->wParam && ab->docked) { | 449 } |
422 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "hidden\n"); | 450 |
423 gtk_appbar_unregister(ab, GDK_WINDOW_HWND(ab->win->window)); | |
424 ab->docked = TRUE; | |
425 ab->iconized = TRUE; | |
426 } | |
427 return GDK_FILTER_CONTINUE; | |
428 } | |
429 /** The window's size has changed */ | 451 /** The window's size has changed */ |
430 static GdkFilterReturn wnd_size(GtkAppBar *ab, GdkXEvent *xevent) { | 452 static GdkFilterReturn wnd_size(GtkAppBar *ab, GdkXEvent *xevent) { |
431 MSG *msg = (MSG*)xevent; | 453 MSG *msg = (MSG*)xevent; |
432 | 454 |
433 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_size\n"); | 455 purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_size\n"); |