| 1166 } |
1166 } |
| 1167 |
1167 |
| 1168 static void |
1168 static void |
| 1169 pidgin_status_box_list_position (PidginStatusBox *status_box, int *x, int *y, int *width, int *height) |
1169 pidgin_status_box_list_position (PidginStatusBox *status_box, int *x, int *y, int *width, int *height) |
| 1170 { |
1170 { |
| 1171 GdkScreen *screen; |
|
| 1172 gint monitor_num; |
1171 gint monitor_num; |
| |
1172 GdkMonitor *m = NULL; |
| 1173 GdkRectangle monitor; |
1173 GdkRectangle monitor; |
| 1174 GtkRequisition popup_req; |
1174 GtkRequisition popup_req; |
| 1175 GtkPolicyType hpolicy, vpolicy; |
1175 GtkPolicyType hpolicy, vpolicy; |
| 1176 GtkAllocation allocation; |
1176 GtkAllocation allocation; |
| 1177 |
1177 |
| 1199 gtk_widget_get_preferred_size(status_box->popup_frame, NULL, &popup_req); |
1199 gtk_widget_get_preferred_size(status_box->popup_frame, NULL, &popup_req); |
| 1200 } |
1200 } |
| 1201 |
1201 |
| 1202 *height = popup_req.height; |
1202 *height = popup_req.height; |
| 1203 |
1203 |
| 1204 screen = gtk_widget_get_screen(GTK_WIDGET(status_box)); |
1204 m = gdk_display_get_monitor_at_window(gdk_display_get_default(), |
| 1205 monitor_num = gdk_screen_get_monitor_at_window(screen, |
|
| 1206 gtk_widget_get_window(GTK_WIDGET(status_box))); |
1205 gtk_widget_get_window(GTK_WIDGET(status_box))); |
| 1207 gdk_screen_get_monitor_geometry(screen, monitor_num, &monitor); |
1206 gdk_monitor_get_geometry(m, &monitor); |
| 1208 |
1207 |
| 1209 if (*x < monitor.x) |
1208 if (*x < monitor.x) |
| 1210 *x = monitor.x; |
1209 *x = monitor.x; |
| 1211 else if (*x + *width > monitor.x + monitor.width) |
1210 else if (*x + *width > monitor.x + monitor.width) |
| 1212 *x = monitor.x + monitor.width - *width; |
1211 *x = monitor.x + monitor.width - *width; |