diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog index 390496334..207a395fc 100644 --- a/capplets/keyboard/ChangeLog +++ b/capplets/keyboard/ChangeLog @@ -1,3 +1,8 @@ +2006-04-22 Sergey Udaltsov + + gnome-keyboard-properties-xkblt.c: + Layout Preview window saves/restores geometry + 2006-03-02 Sergey Udaltsov Fixes #336396 diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c index bf2bcc82b..46203eafd 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c @@ -521,6 +521,8 @@ xkb_layout_chooser_response(GtkDialog *dialog, gint response, GladeXML *chooserDialog) { + GdkRectangle rect; + if (response == GTK_RESPONSE_OK) { GtkTreeSelection *selection = @@ -573,6 +575,10 @@ xkb_layout_chooser_response(GtkDialog *dialog, clear_xkb_elements_list (layoutsList); } } + + gtk_window_get_position (GTK_WINDOW (dialog), &rect.x, &rect.y); + gtk_window_get_size (GTK_WINDOW (dialog), &rect.width, &rect.height); + GSwitchItPreviewSave (&rect); } static void @@ -598,6 +604,7 @@ xkb_layout_choose (GladeXML * dialog) GladeXML* chooserDialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gnome-keyboard-properties.glade", "xkb_layout_chooser", NULL); GtkWidget* chooser = CWID ( "xkb_layout_chooser"); GtkWidget* kbdraw = NULL; + GtkWidget* toplevel = NULL; gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID ("keyboard_dialog"))); @@ -620,6 +627,18 @@ xkb_layout_choose (GladeXML * dialog) g_signal_connect (G_OBJECT (chooser), "response", G_CALLBACK (xkb_layout_chooser_response), chooserDialog); + toplevel = gtk_widget_get_toplevel (chooser); + if (GTK_WIDGET_TOPLEVEL (toplevel)) + { + GdkRectangle *rect = GSwitchItPreviewLoad (); + if (rect != NULL) + { + gtk_window_move (GTK_WINDOW (toplevel), rect->x, rect->y); + gtk_window_resize (GTK_WINDOW (toplevel), rect->width, rect->height); + g_free (rect); + } + } + gtk_dialog_run (GTK_DIALOG (chooser)); gtk_widget_destroy (chooser); } diff --git a/schemas/desktop_gnome_peripherals_keyboard_xkb.schemas.in b/schemas/desktop_gnome_peripherals_keyboard_xkb.schemas.in index 888fd85e3..1a917e6cb 100644 --- a/schemas/desktop_gnome_peripherals_keyboard_xkb.schemas.in +++ b/schemas/desktop_gnome_peripherals_keyboard_xkb.schemas.in @@ -141,5 +141,53 @@ + + /schemas/apps/gswitchit/preview/x + /apps/gswitchit/preview/x + gnome + int + -1 + + The Keyboard Preview, X offset + The Keyboard Preview, X offset + + + + + /schemas/apps/gswitchit/preview/y + /apps/gswitchit/preview/y + gnome + int + -1 + + The Keyboard Preview, Y offset + The Keyboard Preview, Y offset + + + + + /schemas/apps/gswitchit/preview/width + /apps/gswitchit/preview/width + gnome + int + -1 + + The Keyboard Preview, width + The Keyboard Preview, width + + + + + /schemas/apps/gswitchit/preview/height + /apps/gswitchit/preview/height + gnome + int + -1 + + The Keyboard Preview, height + The Keyboard Preview, height + + +