X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fmain.c;h=4eda9ea60bb560dcaa1f51c7b81c923085d13eb1;hb=7e0f130c69b3a36d665b269a7e9cd1560f77bb0b;hp=1c8acbfca25e16a89d2b5072c69f3a22d60f82fd;hpb=881e9a45693f4d724512fdc5297ba312d447851b;p=xournal.git diff --git a/src/main.c b/src/main.c index 1c8acbf..4eda9ea 100644 --- a/src/main.c +++ b/src/main.c @@ -131,9 +131,12 @@ void init_stuff (int argc, char *argv[]) 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_foreach(GTK_CONTAINER(winMain), unset_flags, (gpointer)GTK_CAN_FOCUS); + 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 @@ -184,14 +187,14 @@ void init_stuff (int argc, char *argv[]) dev_list = gdk_devices_list(); while (dev_list != NULL) { device = (GdkDevice *)dev_list->data; - if (device != gdk_device_get_core_pointer()) { + if (device != gdk_device_get_core_pointer() && device->num_axes >= 2) { /* get around a GDK bug: map the valuator range CORRECTLY to [0,1] */ #ifdef ENABLE_XINPUT_BUGFIX gdk_device_set_axis_use(device, 0, GDK_AXIS_IGNORE); gdk_device_set_axis_use(device, 1, GDK_AXIS_IGNORE); #endif gdk_device_set_mode(device, GDK_MODE_SCREEN); - if (g_str_has_suffix(device->name, "eraser")) + if (g_strrstr(device->name, "raser")) gdk_device_set_source(device, GDK_SOURCE_ERASER); can_xinput = TRUE; } @@ -201,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( @@ -227,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( @@ -262,17 +266,11 @@ void init_stuff (int argc, char *argv[]) "event", G_CALLBACK (filter_extended_events), NULL); } - if (!gtk_check_version(2, 17, 0)) { - 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...)