]> git.donarmstrong.com Git - xournal.git/blobdiff - src/main.c
xinput bugfixes, autoload pdf.xoj option, papercolor chooser
[xournal.git] / src / main.c
index 001d09b6e3bdb6f44cede862f4cc0a011b5a8f92..54fd51d404ae2f146019a5428f3d22710d7b12eb 100644 (file)
@@ -126,6 +126,18 @@ void init_stuff (int argc, char *argv[])
   allow_all_accels();
   add_scroll_bindings();
 
+  // prevent interface items from stealing focus
+  // glade doesn't properly handle can_focus, so manually set it
+  gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(GET_COMPONENT("comboLayer")), FALSE);
+  g_signal_connect(GET_COMPONENT("spinPageNo"), "activate",
+          G_CALLBACK(handle_activate_signal), NULL);
+  gtk_container_forall(GTK_CONTAINER(winMain), unset_flags, (gpointer)GTK_CAN_FOCUS);
+  GTK_WIDGET_SET_FLAGS(GTK_WIDGET(canvas), GTK_CAN_FOCUS);
+  GTK_WIDGET_SET_FLAGS(GTK_WIDGET(GET_COMPONENT("spinPageNo")), GTK_CAN_FOCUS);
+  
+  // install hooks on button/key/activation events to make the spinPageNo lose focus
+  gtk_container_forall(GTK_CONTAINER(winMain), install_focus_hooks, NULL);
+
   // set up and initialize the canvas
 
   gtk_widget_show (GTK_WIDGET (canvas));
@@ -192,12 +204,13 @@ void init_stuff (int argc, char *argv[])
     gtk_widget_set_sensitive(GET_COMPONENT("optionsUseXInput"), FALSE);
 
   ui.use_xinput = ui.allow_xinput && can_xinput;
-  ui.need_emergency_disable_xinput = FALSE;
 
   gtk_check_menu_item_set_active(
     GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsProgressiveBG")), ui.progressive_bg);
   gtk_check_menu_item_set_active(
     GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsPrintRuling")), ui.print_ruling);
+  gtk_check_menu_item_set_active(
+    GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsAutoloadPdfXoj")), ui.autoload_pdf_xoj);
   gtk_check_menu_item_set_active(
     GTK_CHECK_MENU_ITEM(GET_COMPONENT("optionsLeftHanded")), ui.left_handed);
   gtk_check_menu_item_set_active(
@@ -218,7 +231,7 @@ void init_stuff (int argc, char *argv[])
   
   gtk_widget_show (winMain);
   update_cursor();
-  
+
   /* this will cause extension events to get enabled/disabled, but
      we need the windows to be mapped first */
   gtk_check_menu_item_set_active(
@@ -252,16 +265,12 @@ void init_stuff (int argc, char *argv[])
       (gpointer)(gtk_scrolled_window_get_hscrollbar(GTK_SCROLLED_WINDOW(w))),
       "event", G_CALLBACK (filter_extended_events),
       NULL);
-    g_signal_connect (
-      GET_COMPONENT("comboLayer"),
-      "notify::popup-shown", G_CALLBACK (combobox_popup_disable_xinput),
-      NULL);
   }
 
   // load the MRU
   
   init_mru();
-  
+
   // and finally, open a file specified on the command line
   // (moved here because display parameters weren't initialized yet...)