Mercurial > pidgin.yaz
diff src/win32/systray.c @ 4106:a843ce9d77ea
[gaim-migrate @ 4321]
code re-org
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Fri, 20 Dec 2002 18:10:17 +0000 |
parents | 003e0a02d6b9 |
children | f5e7949668a5 |
line wrap: on
line diff
--- a/src/win32/systray.c Fri Dec 20 18:08:47 2002 +0000 +++ b/src/win32/systray.c Fri Dec 20 18:10:17 2002 +0000 @@ -370,59 +370,6 @@ } /* - * GAIM WINDOW FILTERS - **********************/ - -static GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { - - MSG *msg = (MSG*)xevent; - - switch( msg->message ) { - case WM_SYSCOMMAND: - if( msg->wParam == SC_MINIMIZE ) { - hide_buddy_list(); - return GDK_FILTER_REMOVE; - } - break; - case WM_CLOSE: - hide_buddy_list(); - return GDK_FILTER_REMOVE; - } - - return GDK_FILTER_CONTINUE; -} - -static GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { - MSG *msg = (MSG*)xevent; - - switch( msg->message ) { - case WM_CLOSE: - wgaim_systray_minimize(mainwindow); - gtk_widget_hide(mainwindow); - return GDK_FILTER_REMOVE; - } - - return GDK_FILTER_CONTINUE; -} - -static GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { - MSG *msg = (MSG*)xevent; - - switch( msg->message ) { - case WM_SYSCOMMAND: - if( msg->wParam == SC_MINIMIZE ) { - if(imaway) { - wgaim_systray_minimize(imaway); - gtk_widget_hide(imaway); - } - return GDK_FILTER_REMOVE; - } - break; - } - return GDK_FILTER_CONTINUE; -} - -/* * GAIM EVENT CALLBACKS ***********************/ @@ -450,6 +397,60 @@ * PUBLIC CODE */ +/* + * GAIM WINDOW FILTERS + **********************/ + +GdkFilterReturn st_buddywin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { + + MSG *msg = (MSG*)xevent; + + switch( msg->message ) { + case WM_SYSCOMMAND: + if( msg->wParam == SC_MINIMIZE ) { + hide_buddy_list(); + return GDK_FILTER_REMOVE; + } + break; + case WM_CLOSE: + hide_buddy_list(); + return GDK_FILTER_REMOVE; + } + + return GDK_FILTER_CONTINUE; +} + +GdkFilterReturn st_loginwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { + MSG *msg = (MSG*)xevent; + + switch( msg->message ) { + case WM_CLOSE: + wgaim_systray_minimize(mainwindow); + gtk_widget_hide(mainwindow); + return GDK_FILTER_REMOVE; + } + + return GDK_FILTER_CONTINUE; +} + +GdkFilterReturn st_backwin_filter( GdkXEvent *xevent, GdkEvent *event, gpointer data) { + MSG *msg = (MSG*)xevent; + + switch( msg->message ) { + case WM_SYSCOMMAND: + if( msg->wParam == SC_MINIMIZE ) { + if(imaway) { + wgaim_systray_minimize(imaway); + gtk_widget_hide(imaway); + } + return GDK_FILTER_REMOVE; + } + break; + } + return GDK_FILTER_CONTINUE; +} + + /* Create a hidden window and associate it with the systray icon. We use this hidden window to proccess WM_TRAYMESSAGE msgs. */ void wgaim_systray_init(void) { @@ -484,26 +485,6 @@ DestroyWindow(systray_hwnd); } -/* This function is called after the buddy list has been created */ -void wgaim_created_blistwin( GtkWidget *blist ) { - gdk_window_add_filter (GTK_WIDGET(blist)->window, - st_buddywin_filter, - NULL); -} - -/* This function is called after the login window has been created */ -void wgaim_created_loginwin( GtkWidget *loginwin ) { - gdk_window_add_filter (GTK_WIDGET(loginwin)->window, - st_loginwin_filter, - NULL); -} - -void wgaim_created_backwin( GtkWidget *backwin ) { - gdk_window_add_filter (GTK_WIDGET(backwin)->window, - st_backwin_filter, - NULL); -} - void wgaim_systray_minimize( GtkWidget *window ) { MinimizeWndToTray(GDK_WINDOW_HWND(window->window)); }