[gimp] Bug 756178 - Crash on new layer creation in fullscreen mode
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 756178 - Crash on new layer creation in fullscreen mode
- Date: Sat, 16 Apr 2016 23:41:28 +0000 (UTC)
commit cdc7542d46a6d3c6b2c223d14f63e7d29d9571ec
Author: Kristian Rietveld <kris loopnest org>
Date: Sun Apr 17 00:32:27 2016 +0100
Bug 756178 - Crash on new layer creation in fullscreen mode
Disable "new-style" fullscreen mode on OS X, we need support in
GTK+ in order for this to work properly. The currently available
fullscreen option in View > Fullscreen works fine and we plan to
migrate to the "new-style" fullscreen support in the future.
app/display/Makefile.am | 7 ++++++-
app/display/gimpimagewindow.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/app/display/Makefile.am b/app/display/Makefile.am
index a6bcbc9..7dbd0c4 100644
--- a/app/display/Makefile.am
+++ b/app/display/Makefile.am
@@ -1,5 +1,9 @@
## Process this file with automake to produce Makefile.in
+if PLATFORM_OSX
+xobjective_c = "-xobjective-c"
+endif
+
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Display\" \
-I$(top_builddir) \
@@ -8,7 +12,8 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/app \
$(GEGL_CFLAGS) \
$(GTK_CFLAGS) \
- -I$(includedir)
+ -I$(includedir) \
+ $(xobjective_c)
noinst_LIBRARIES = libappdisplay.a
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 6e8455e..9914b24 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -20,6 +20,11 @@
#include <gegl.h>
#include <gtk/gtk.h>
+#ifdef GDK_WINDOWING_QUARTZ
+#import <AppKit/AppKit.h>
+#include <gdk/gdkquartz.h>
+#endif /* !GDK_WINDOWING_QUARTZ */
+
#include "libgimpmath/gimpmath.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpwidgets/gimpwidgets.h"
@@ -157,6 +162,7 @@ static void gimp_image_window_get_property (GObject *obj
GValue *value,
GParamSpec *pspec);
+static void gimp_image_window_map (GtkWidget *widget);
static gboolean gimp_image_window_delete_event (GtkWidget *widget,
GdkEventAny *event);
static gboolean gimp_image_window_configure_event (GtkWidget *widget,
@@ -277,6 +283,7 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
object_class->set_property = gimp_image_window_set_property;
object_class->get_property = gimp_image_window_get_property;
+ widget_class->map = gimp_image_window_map;
widget_class->delete_event = gimp_image_window_delete_event;
widget_class->configure_event = gimp_image_window_configure_event;
widget_class->window_state_event = gimp_image_window_window_state_event;
@@ -597,6 +604,34 @@ gimp_image_window_get_property (GObject *object,
}
}
+static void
+gimp_image_window_map (GtkWidget *widget)
+{
+#ifdef GDK_WINDOWING_QUARTZ
+ GdkWindow *gdk_window;
+ NSWindow *ns_window;
+#endif /* !GDK_WINDOWING_QUARTZ */
+
+ GTK_WIDGET_CLASS (parent_class)->map (widget);
+
+#ifdef GDK_WINDOWING_QUARTZ
+ gdk_window = gtk_widget_get_window (GTK_WIDGET (widget));
+ ns_window = gdk_quartz_window_get_nswindow (gdk_window);
+
+ /* Disable the new-style full screen mode. For now only the "old-style"
+ * full screen mode, via the "View" menu, is supported. In the future, and
+ * as soon as GTK+ has proper support for this, we will migrate to the
+ * new-style full screen mode.
+ */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
+ ns_window.collectionBehavior |= NSWindowCollectionBehaviorFullScreenAuxiliary;
+#else
+ /* Hard code the define ... */
+ ns_window.collectionBehavior |= 1 << 8;
+#endif
+#endif /* !GDK_WINDOWING_QUARTZ */
+}
+
static gboolean
gimp_image_window_delete_event (GtkWidget *widget,
GdkEventAny *event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]