diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-08-15 22:20:16 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-08-16 21:27:35 +0000 |
| commit | e9ded04d15ee12fec8c023f2dba95135fceac154 (patch) | |
| tree | 778601d0c462b94c73d275eaa419ac5fbb599d1c /src/inkscape-window.cpp | |
| parent | Fix a bug in fillet/chamfer LPE pointed in mailing list by Miguel Lopez. Fill... (diff) | |
| download | inkscape-e9ded04d15ee12fec8c023f2dba95135fceac154.tar.gz inkscape-e9ded04d15ee12fec8c023f2dba95135fceac154.zip | |
fix #385 inbox#765 macOS accelerators
- re-fix Cmd-Q confirmation dialog (#383) without the numbers typing regression (#385)
- re-fix Alt modifiers (inbox#765)
- fix Cmd-A select all text (inbox#765)
Diffstat (limited to 'src/inkscape-window.cpp')
| -rw-r--r-- | src/inkscape-window.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/inkscape-window.cpp b/src/inkscape-window.cpp index 3629b45f3..27ca5309b 100644 --- a/src/inkscape-window.cpp +++ b/src/inkscape-window.cpp @@ -120,11 +120,24 @@ InkscapeWindow::change_document(SPDocument* document) } } +/** + * Return true if this is the Cmd-Q shortcut on macOS + */ +inline bool is_Cmd_Q(GdkEventKey *event) +{ +#ifdef GDK_WINDOWING_QUARTZ + return (event->keyval == 'q' && event->state == (GDK_MOD2_MASK | GDK_META_MASK)); +#else + return false; +#endif +} + bool InkscapeWindow::on_key_press_event(GdkEventKey* event) { // Need to call base class method first or text tool won't work! - bool done = Gtk::Window::on_key_press_event(event); + // Intercept Cmd-Q on macOS to not bypass confirmation dialog + bool done = !is_Cmd_Q(event) && Gtk::Window::on_key_press_event(event); if (done) { return true; } |
