+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
}
else {
curtime = time(NULL);
- strftime(stime, 30, "%F-Note-%H-%M.xoj", localtime(&curtime));
+ strftime(stime, 30, "%Y-%m-%d-Note-%H-%M.xoj", localtime(&curtime));
if (ui.default_path!=NULL)
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), stime);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), g_basename(in_fn));
} else {
curtime = time(NULL);
- strftime(stime, 30, "%F-Note-%H-%M.pdf", localtime(&curtime));
+ strftime(stime, 30, "%Y-%m-%d-Note-%H-%M.pdf", localtime(&curtime));
if (ui.default_path!=NULL)
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER (dialog), ui.default_path);
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog), stime);
aboutDialog = create_aboutDialog ();
labelTitle = GTK_LABEL(g_object_get_data(G_OBJECT(aboutDialog), "labelTitle"));
gtk_label_set_markup(labelTitle,
- "<span size=\"xx-large\" weight=\"bold\">Xournal " VERSION "</span>");
+ "<span size=\"xx-large\" weight=\"bold\">Xournal " VERSION_STRING "</span>");
gtk_dialog_run (GTK_DIALOG(aboutDialog));
gtk_widget_destroy(aboutDialog);
}
}
if ((event->state & (GDK_CONTROL_MASK|GDK_MOD1_MASK)) != 0) return FALSE;
// no control-clicking or alt-clicking
+ if (!is_core) gdk_device_get_state(event->device, event->window, event->axes, NULL);
+ // synaptics touchpads send bogus axis values with ButtonDown
if (!is_core)
fix_xinput_coords((GdkEvent *)event);
ui.which_mouse_button = event->button;
switch_mapping(mapping);
+#ifdef WIN32
+ update_cursor();
+#endif
// in text tool, clicking in a text area edits it
if (ui.toolno[mapping] == TOOL_TEXT) {
/* re-enable input devices after they've been emergency-disabled
by leave_notify */
if (!gtk_check_version(2, 17, 0)) {
+ gdk_flush();
+ gdk_error_trap_push();
for (dev_list = gdk_devices_list(); dev_list != NULL; dev_list = dev_list->next) {
dev = GDK_DEVICE(dev_list->data);
gdk_device_set_mode(dev, GDK_MODE_SCREEN);
}
+ ui.is_corestroke = ui.saved_is_corestroke;
+ gdk_flush();
+ gdk_error_trap_pop();
}
return FALSE;
}
#endif
/* emergency disable XInput to avoid segfaults (GTK+ 2.17) or
interface non-responsiveness (GTK+ 2.18) */
- if (!gtk_check_version(2, 17, 0)) {
+ if (!gtk_check_version(2, 17, 0)) {
+ gdk_flush();
+ gdk_error_trap_push();
for (dev_list = gdk_devices_list(); dev_list != NULL; dev_list = dev_list->next) {
dev = GDK_DEVICE(dev_list->data);
gdk_device_set_mode(dev, GDK_MODE_DISABLED);
}
+ ui.saved_is_corestroke = ui.is_corestroke;
+ ui.is_corestroke = TRUE;
+ gdk_flush();
+ gdk_error_trap_pop();
}
return FALSE;
}
else if (ui.cur_item_type == ITEM_RESIZESEL) {
finalize_resizesel();
}
+ else if (ui.cur_item_type == ITEM_HAND) {
+ ui.cur_item_type = ITEM_NONE;
+ }
switch_mapping(0);
return FALSE;
}
non-responsive).
*/
+#ifndef WIN32
if (!gtk_check_version(2, 17, 0)) {
+#endif
/* GTK+ 2.17 and later: everybody shares a single native window,
so we'll never get any core events, and we might as well set
extension events the way we're supposed to. Doing so helps solve
events in 2.18 */
gtk_widget_set_extension_events(GTK_WIDGET (canvas),
ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE);
+#ifndef WIN32
} else {
+#endif
/* GTK+ 2.16 and earlier: we only activate extension events on the
canvas's parent GdkWindow. This allows us to keep receiving core
events. */
gdk_input_set_extension_events(GTK_WIDGET(canvas)->window,
GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE);
+#ifndef WIN32
}
+#endif
update_mappings_menu();
}
ui.autoload_pdf_xoj = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
}
-void
-on_optionsDiscardCore_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- end_text();
- ui.discard_corepointer =
- gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem));
- update_mappings_menu();
-}
-
void
on_fontButton_font_set (GtkFontButton *fontbutton,
gpointer user_data)