diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2012-03-17 09:20:17 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2012-03-17 09:20:17 -0700 |
commit | 1451553761d0cff4b5f412fcb419602118d1dc28 (patch) | |
tree | 6a7eb95aa97bc2e2cfb1acccb768a3f668972f9c /test/previewer.c | |
parent | 0819152d4d3f257e8406d0cace54f49da354fc0f (diff) |
Drop explicit grab focus on EvView
It turns out that the reason the toolbar was getting focus first for
my previewer and not the real evince-previewer was that the toolbar
buttons were set as sensitive when the widget was shown. If instead
the document is loaded after the window is shown like in both the
plugin and the real previewer, then the initial focus will be on the
scrolled window as desired.
Diffstat (limited to 'test/previewer.c')
-rw-r--r-- | test/previewer.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/previewer.c b/test/previewer.c index a684b97..ea748eb 100644 --- a/test/previewer.c +++ b/test/previewer.c @@ -112,6 +112,12 @@ main(int argc, char *argv[]) gtk_window_set_default_icon_name("evince"); viewer = evbp_viewer_new(); + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_default_size(GTK_WINDOW(window), 800, 800); + g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); + gtk_container_add(GTK_CONTAINER(window), viewer); + gtk_widget_show_all(window); + if (!evbp_viewer_load_uri(EVBP_VIEWER(viewer), uri, &error)) { if (error) { g_printerr("could not open '%s': %s\n", uri, error->message); @@ -122,14 +128,6 @@ main(int argc, char *argv[]) } g_free(uri); - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size(GTK_WINDOW(window), 800, 800); - g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); - - gtk_container_add(GTK_CONTAINER(window), viewer); - gtk_widget_grab_focus(EVBP_VIEWER(viewer)->view); - gtk_widget_show_all(window); - gtk_main(); ev_shutdown(); |