Mercurial > pidgin.yaz
comparison pidgin/gtkconv.c @ 18791:f36fc45b7866
really make restoring size and position work
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Thu, 09 Aug 2007 02:27:40 +0000 |
parents | 42161f9233bf |
children | e9fe99a23ab0 |
comparison
equal
deleted
inserted
replaced
18790:42161f9233bf | 18791:f36fc45b7866 |
---|---|
8322 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired | 8322 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired |
8323 * when the window is being maximized */ | 8323 * when the window is being maximized */ |
8324 if (gdk_window_get_state(w->window) & GDK_WINDOW_STATE_MAXIMIZED) | 8324 if (gdk_window_get_state(w->window) & GDK_WINDOW_STATE_MAXIMIZED) |
8325 return FALSE; | 8325 return FALSE; |
8326 | 8326 |
8327 /* don't save if nothing changed */ | |
8328 if (x == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/x") && | |
8329 y == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/y")) | |
8330 return FALSE; /* carry on normally */ | |
8331 | |
8332 /* don't save off-screen positioning */ | 8327 /* don't save off-screen positioning */ |
8333 if (x + event->width < 0 || | 8328 if (x + event->width < 0 || |
8334 y + event->height < 0 || | 8329 y + event->height < 0 || |
8335 x > gdk_screen_width() || | 8330 x > gdk_screen_width() || |
8336 y > gdk_screen_height()) | 8331 y > gdk_screen_height()) |
8374 } | 8369 } |
8375 | 8370 |
8376 static void | 8371 static void |
8377 pidgin_conv_restore_position(PidginWindow *win) { | 8372 pidgin_conv_restore_position(PidginWindow *win) { |
8378 pidgin_conv_set_position_size(win, | 8373 pidgin_conv_set_position_size(win, |
8379 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/x"), | 8374 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/x"), |
8380 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/y"), | 8375 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/y"), |
8381 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/width"), | 8376 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"), |
8382 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/height")); | 8377 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height")); |
8383 } | 8378 } |
8384 | 8379 |
8385 PidginWindow * | 8380 PidginWindow * |
8386 pidgin_conv_window_new() | 8381 pidgin_conv_window_new() |
8387 { | 8382 { |
9026 conv_placement_new_window(PidginConversation *conv) | 9021 conv_placement_new_window(PidginConversation *conv) |
9027 { | 9022 { |
9028 PidginWindow *win; | 9023 PidginWindow *win; |
9029 | 9024 |
9030 win = pidgin_conv_window_new(); | 9025 win = pidgin_conv_window_new(); |
9026 | |
9031 g_signal_connect(G_OBJECT(win->window), "configure_event", | 9027 g_signal_connect(G_OBJECT(win->window), "configure_event", |
9032 G_CALLBACK(gtk_conv_configure_cb), NULL); | 9028 G_CALLBACK(gtk_conv_configure_cb), NULL); |
9033 | 9029 |
9034 pidgin_conv_window_add_gtkconv(win, conv); | 9030 pidgin_conv_window_add_gtkconv(win, conv); |
9035 | 9031 |