mirror of https://github.com/GNOME/gimp.git
app: Fix key presses not working on mac
Part fixes #9322. This was making GIMP on MacOS unusable.
This commit is contained in:
parent
780cda6f72
commit
df4ed9c1ec
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#ifdef GDK_WINDOWING_QUARTZ
|
#ifdef GDK_WINDOWING_QUARTZ
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
#include <gtkosxapplication.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gui/gui-types.h"
|
#include "gui/gui-types.h"
|
||||||
|
@ -262,30 +261,6 @@ gui_unique_quartz_idle_open (GFile *file)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gui_unique_quartz_nsopen_file_callback (GtkosxApplication *osx_app,
|
|
||||||
gchar *path,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GSource *source;
|
|
||||||
GClosure *closure;
|
|
||||||
|
|
||||||
closure = g_cclosure_new (G_CALLBACK (gui_unique_quartz_idle_open),
|
|
||||||
g_file_new_for_path (path),
|
|
||||||
(GClosureNotify) g_object_unref);
|
|
||||||
|
|
||||||
g_object_watch_closure (G_OBJECT (unique_gimp), closure);
|
|
||||||
|
|
||||||
source = g_idle_source_new ();
|
|
||||||
|
|
||||||
g_source_set_priority (source, G_PRIORITY_LOW);
|
|
||||||
g_source_set_closure (source, closure);
|
|
||||||
g_source_attach (source, NULL);
|
|
||||||
g_source_unref (source);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@implementation GimpAppleEventHandler
|
@implementation GimpAppleEventHandler
|
||||||
- (void) handleEvent: (NSAppleEventDescriptor *) inEvent
|
- (void) handleEvent: (NSAppleEventDescriptor *) inEvent
|
||||||
andReplyWith: (NSAppleEventDescriptor *) replyEvent
|
andReplyWith: (NSAppleEventDescriptor *) replyEvent
|
||||||
|
@ -328,19 +303,11 @@ gui_unique_quartz_nsopen_file_callback (GtkosxApplication *osx_app,
|
||||||
static void
|
static void
|
||||||
gui_unique_quartz_init (Gimp *gimp)
|
gui_unique_quartz_init (Gimp *gimp)
|
||||||
{
|
{
|
||||||
GtkosxApplication *osx_app;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||||
g_return_if_fail (unique_gimp == NULL);
|
g_return_if_fail (unique_gimp == NULL);
|
||||||
|
|
||||||
osx_app = gtkosx_application_get ();
|
|
||||||
|
|
||||||
unique_gimp = gimp;
|
unique_gimp = gimp;
|
||||||
|
|
||||||
g_signal_connect (osx_app, "NSApplicationOpenFile",
|
|
||||||
G_CALLBACK (gui_unique_quartz_nsopen_file_callback),
|
|
||||||
gimp);
|
|
||||||
|
|
||||||
/* Using the event handler is a hack, it is necessary because
|
/* Using the event handler is a hack, it is necessary because
|
||||||
* gtkosx_application will drop the file open events if any
|
* gtkosx_application will drop the file open events if any
|
||||||
* event processing is done before gtkosx_application_ready is
|
* event processing is done before gtkosx_application_ready is
|
||||||
|
|
|
@ -31,7 +31,7 @@ libappgui = static_library('appgui',
|
||||||
include_directories: [ rootInclude, rootAppInclude, ],
|
include_directories: [ rootInclude, rootAppInclude, ],
|
||||||
c_args: '-DG_LOG_DOMAIN="Gimp-GUI"',
|
c_args: '-DG_LOG_DOMAIN="Gimp-GUI"',
|
||||||
dependencies: [
|
dependencies: [
|
||||||
cairo, gegl, gdk_pixbuf, gio_specific, gtk3, gtk3_macos
|
cairo, gegl, gdk_pixbuf, gio_specific, gtk3
|
||||||
],
|
],
|
||||||
install: false,
|
install: false,
|
||||||
)
|
)
|
||||||
|
|
|
@ -185,7 +185,7 @@ libgimpwidgets_introspectable = [
|
||||||
libgimpwidgets_headers_introspectable,
|
libgimpwidgets_headers_introspectable,
|
||||||
]
|
]
|
||||||
|
|
||||||
if gtk3_macos.found()
|
if platform_osx
|
||||||
libgimpwidgets_sources += [
|
libgimpwidgets_sources += [
|
||||||
'gimppickbutton-quartz.c',
|
'gimppickbutton-quartz.c',
|
||||||
]
|
]
|
||||||
|
|
11
meson.build
11
meson.build
|
@ -1149,17 +1149,6 @@ if not lua.found() and have_lua
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Check for GTK Mac Integration
|
|
||||||
if platform_osx and (gtk3.get_variable(pkgconfig: 'targets').contains('quartz'))
|
|
||||||
# Support for homebrew version of gtk-mac-integration
|
|
||||||
gtk3_macos = dependency('gtk-mac-integration-gtk3', version: '>=3.0.1', required: false)
|
|
||||||
if not gtk3_macos.found()
|
|
||||||
gtk3_macos = dependency('gtk-mac-integration', version: '>=3.0.1')
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
gtk3_macos = no_dep
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Check for XML tools
|
# Check for XML tools
|
||||||
xmllint = find_program('xmllint', required: false)
|
xmllint = find_program('xmllint', required: false)
|
||||||
xsltproc = find_program('xsltproc')
|
xsltproc = find_program('xsltproc')
|
||||||
|
|
Loading…
Reference in New Issue