Make popups come up on the same screen as the combo box. (#133544, Morten

Sun Feb  8 01:44:06 2004  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make popups
	come up on the same screen as the combo box.  (#133544,
	Morten Welinder)
This commit is contained in:
Matthias Clasen
2004-02-08 00:42:59 +00:00
committed by Matthias Clasen
parent 0180cce7f9
commit 41e49106e3
6 changed files with 61 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
Sun Feb 8 01:44:06 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make popups
come up on the same screen as the combo box. (#133544,
Morten Welinder)
Fri Feb 6 23:40:24 2004 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkfilechooserdefault.c (create_file_list): clean up the

View File

@@ -1,3 +1,9 @@
Sun Feb 8 01:44:06 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make popups
come up on the same screen as the combo box. (#133544,
Morten Welinder)
Fri Feb 6 23:40:24 2004 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkfilechooserdefault.c (create_file_list): clean up the

View File

@@ -1,3 +1,9 @@
Sun Feb 8 01:44:06 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make popups
come up on the same screen as the combo box. (#133544,
Morten Welinder)
Fri Feb 6 23:40:24 2004 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkfilechooserdefault.c (create_file_list): clean up the

View File

@@ -1,3 +1,9 @@
Sun Feb 8 01:44:06 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make popups
come up on the same screen as the combo box. (#133544,
Morten Welinder)
Fri Feb 6 23:40:24 2004 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkfilechooserdefault.c (create_file_list): clean up the

View File

@@ -1,3 +1,9 @@
Sun Feb 8 01:44:06 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Make popups
come up on the same screen as the combo box. (#133544,
Morten Welinder)
Fri Feb 6 23:40:24 2004 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkfilechooserdefault.c (create_file_list): clean up the

View File

@@ -631,12 +631,36 @@ gtk_combo_box_menu_hide (GtkWidget *menu,
FALSE);
}
static void
gtk_combo_box_detacher (GtkWidget *widget,
GtkMenu *menu)
{
GtkComboBox *combo_box;
g_return_if_fail (GTK_IS_COMBO_BOX (widget));
combo_box = GTK_COMBO_BOX (widget);
g_return_if_fail (combo_box->priv->popup_widget == (GtkWidget*) menu);
g_signal_handlers_disconnect_by_func (menu,
gtk_combo_box_menu_show,
combo_box);
g_signal_handlers_disconnect_by_func (menu,
gtk_combo_box_menu_hide,
combo_box);
combo_box->priv->popup_widget = NULL;
}
static void
gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
GtkWidget *popup)
{
if (GTK_IS_MENU (combo_box->priv->popup_widget))
combo_box->priv->popup_widget = NULL;
{
gtk_menu_detach (GTK_MENU (combo_box->priv->popup_widget));
combo_box->priv->popup_widget = NULL;
}
else if (combo_box->priv->popup_widget)
{
gtk_container_remove (GTK_CONTAINER (combo_box->priv->popup_frame),
@@ -660,14 +684,18 @@ gtk_combo_box_set_popup_widget (GtkComboBox *combo_box,
g_signal_connect (popup, "hide",
G_CALLBACK (gtk_combo_box_menu_hide), combo_box);
/* FIXME: need to attach to widget? */
gtk_menu_attach_to_widget (GTK_MENU (popup),
GTK_WIDGET (combo_box),
gtk_combo_box_detacher);
}
else
{
if (!combo_box->priv->popup_window)
{
combo_box->priv->popup_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_screen (combo_box->priv->popup_window,
gtk_widget_get_screen (combo_box));
combo_box->priv->popup_frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->popup_frame),
GTK_SHADOW_NONE);