Created
July 5, 2017 18:53
-
-
Save willscott/fb5d50eba8a2fda17b7ead7d6e6ed98d to your computer and use it in GitHub Desktop.
Mac compilation for gcr @ 27b2703
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 742873d484f31716c7282fbab7496597624392f6 Mon Sep 17 00:00:00 2001 | |
From: Will Scott | |
Date: Wed, 5 Jul 2017 11:43:32 -0700 | |
Subject: [PATCH] patch for osx compilation | |
--- | |
configure.ac | 2 +- | |
docs/reference/gck/Makefile.am | 2 +- | |
docs/reference/gcr/Makefile.am | 6 ++-- | |
ui/frob-prompt.c | 10 +++--- | |
ui/frob-system-prompt.c | 10 +++--- | |
ui/gcr-prompt-dialog.c | 81 ++++++++++++++++++++++-------------------- | |
ui/gcr-prompter-tool.c | 2 +- | |
7 files changed, 58 insertions(+), 55 deletions(-) | |
diff --git a/configure.ac b/configure.ac | |
index 4cd50d7..91e67b7 100644 | |
--- a/configure.ac | |
+++ b/configure.ac | |
@@ -117,7 +117,7 @@ AC_ARG_WITH(gtk, [ | |
AM_CONDITIONAL(WITH_GTK, test "$with_gtk" != "no") | |
if test "x$with_gtk" != "xno"; then | |
- PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQ gtk+-x11-3.0 >= $GTK_REQ) | |
+ PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQ gdk-quartz-3.0 >= $GTK_REQ) | |
AC_SUBST(GTK_CFLAGS) | |
AC_SUBST(GTK_LIBS) | |
fi | |
diff --git a/docs/reference/gck/Makefile.am b/docs/reference/gck/Makefile.am | |
index 02da77b..8fdf94f 100644 | |
--- a/docs/reference/gck/Makefile.am | |
+++ b/docs/reference/gck/Makefile.am | |
@@ -94,7 +94,7 @@ include $(top_srcdir)/gtk-doc.make | |
# Other files to distribute | |
# e.g. EXTRA_DIST += version.xml.in | |
-EXTRA_DIST += | |
+#EXTRA_DIST += | |
# Files not to distribute | |
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types | |
diff --git a/docs/reference/gcr/Makefile.am b/docs/reference/gcr/Makefile.am | |
index 1c6a9ee..c98a013 100644 | |
--- a/docs/reference/gcr/Makefile.am | |
+++ b/docs/reference/gcr/Makefile.am | |
@@ -172,6 +172,6 @@ gcr-shooter: $(SHOOTER_SRCS) $(SHOOTER_HEADERS) Makefile | |
$(GTK_LDFLAGS) -lm $(top_builddir)/ui/libgcr-ui-@[email protected] \ | |
$(SHOOTER_SRCS) | |
-EXTRA_DIST += $(SHOOTER_SRCS) \ | |
- $(SHOOTER_HEADERS) \ | |
- images | |
+#EXTRA_DIST += $(SHOOTER_SRCS) \ | |
+# $(SHOOTER_HEADERS) \ | |
+# images | |
diff --git a/ui/frob-prompt.c b/ui/frob-prompt.c | |
index 20462f6..6ca4f9f 100644 | |
--- a/ui/frob-prompt.c | |
+++ b/ui/frob-prompt.c | |
@@ -25,7 +25,7 @@ | |
#include "gcr/gcr-base.h" | |
#include <gtk/gtk.h> | |
-#include <gdk/gdkx.h> | |
+//#include <gdk/gdkx.h> | |
#include <err.h> | |
@@ -78,9 +78,9 @@ prompt_perform (GtkWidget *parent) | |
errx (1, "couldn't create prompt: %s", error->message); | |
if (parent) { | |
- caller_id = g_strdup_printf ("%lu", (gulong)GDK_WINDOW_XID (gtk_widget_get_window (parent))); | |
- gcr_prompt_set_caller_window (GCR_PROMPT (prompt), caller_id); | |
- g_free (caller_id); | |
+ //caller_id = g_strdup_printf ("%lu", (gulong)GDK_WINDOW_XID (gtk_widget_get_window (parent))); | |
+ //gcr_prompt_set_caller_window (GCR_PROMPT (prompt), caller_id); | |
+ //g_free (caller_id); | |
} | |
loop = g_main_loop_new (NULL, FALSE); | |
@@ -166,7 +166,7 @@ on_prompt_clicked (GtkToolButton *button, | |
static gboolean | |
on_window_delete (GtkWidget *widget, | |
- GdkEvent *event, | |
+ gpointer event, | |
gpointer user_data) | |
{ | |
gtk_main_quit (); | |
diff --git a/ui/frob-system-prompt.c b/ui/frob-system-prompt.c | |
index e08114f..3f79fdf 100644 | |
--- a/ui/frob-system-prompt.c | |
+++ b/ui/frob-system-prompt.c | |
@@ -26,7 +26,7 @@ | |
#include "egg/egg-testing.h" | |
#include <gtk/gtk.h> | |
-#include <gdk/gdkx.h> | |
+//#include <gdk/gdkx.h> | |
#include <unistd.h> | |
#include <string.h> | |
@@ -54,9 +54,9 @@ on_prompt_clicked (GtkToolButton *button, | |
gcr_prompt_set_message (GCR_PROMPT (prompt), "This is the message"); | |
gcr_prompt_set_description (GCR_PROMPT (prompt), "This is the description"); | |
- caller_id = g_strdup_printf ("%lu", (gulong)GDK_WINDOW_XID (gtk_widget_get_window (parent))); | |
- gcr_prompt_set_caller_window (GCR_PROMPT (prompt), caller_id); | |
- g_free (caller_id); | |
+// caller_id = g_strdup_printf ("%lu", (gulong)GDK_WINDOW_XID (gtk_widget_get_window (parent))); | |
+// gcr_prompt_set_caller_window (GCR_PROMPT (prompt), caller_id); | |
+// g_free (caller_id); | |
password = gcr_prompt_password_run (GCR_PROMPT (prompt), NULL, &error); | |
if (error != NULL) { | |
@@ -73,7 +73,7 @@ on_prompt_clicked (GtkToolButton *button, | |
static gboolean | |
on_window_delete (GtkWidget *widget, | |
- GdkEvent *event, | |
+ gpointer event, | |
gpointer user_data) | |
{ | |
gtk_main_quit (); | |
diff --git a/ui/gcr-prompt-dialog.c b/ui/gcr-prompt-dialog.c | |
index 48088d7..c9d7cbe 100644 | |
--- a/ui/gcr-prompt-dialog.c | |
+++ b/ui/gcr-prompt-dialog.c | |
@@ -27,7 +27,7 @@ | |
#include "gcr-secure-entry-buffer.h" | |
#include <gtk/gtk.h> | |
-#include <gdk/gdkx.h> | |
+/*#include <gdk/gdkquartz.h>*/ | |
#include <glib/gi18n.h> | |
/** | |
@@ -53,11 +53,11 @@ | |
* The class for #GcrPromptDialog. | |
*/ | |
-#ifdef GCR_DISABLE_GRABS | |
+//#ifdef GCR_DISABLE_GRABS | |
#define GRAB_KEYBOARD 0 | |
-#else | |
-#define GRAB_KEYBOARD 1 | |
-#endif | |
+//#else | |
+//#define GRAB_KEYBOARD 1 | |
+//#endif | |
typedef enum { | |
PROMPT_NONE, | |
@@ -107,7 +107,7 @@ struct _GcrPromptDialogPrivate { | |
GtkEntryBuffer *password_buffer; | |
GtkEntryBuffer *confirm_buffer; | |
PromptMode mode; | |
- GdkDevice *grabbed_device; | |
+ //GdkDevice *grabbed_device; | |
gulong grab_broken_id; | |
gboolean grab_disabled; | |
gboolean was_closed; | |
@@ -115,9 +115,9 @@ struct _GcrPromptDialogPrivate { | |
static void gcr_prompt_dialog_prompt_iface (GcrPromptIface *iface); | |
-static gboolean ungrab_keyboard (GtkWidget *win, | |
- GdkEvent *event, | |
- gpointer unused); | |
+//static gboolean ungrab_keyboard (GtkWidget *win, | |
+// GdkEvent *event, | |
+// gpointer unused); | |
G_DEFINE_TYPE_WITH_CODE (GcrPromptDialog, gcr_prompt_dialog, GTK_TYPE_DIALOG, | |
G_IMPLEMENT_INTERFACE (GCR_TYPE_PROMPT, gcr_prompt_dialog_prompt_iface); | |
@@ -126,9 +126,9 @@ G_DEFINE_TYPE_WITH_CODE (GcrPromptDialog, gcr_prompt_dialog, GTK_TYPE_DIALOG, | |
static void | |
update_transient_for (GcrPromptDialog *self) | |
{ | |
- GdkDisplay *display; | |
- GdkWindow *transient_for; | |
- GdkWindow *window; | |
+// GdkDisplay *display; | |
+// GdkWindow *transient_for; | |
+// GdkWindow *window; | |
gint64 handle; | |
gchar *end; | |
@@ -137,9 +137,9 @@ update_transient_for (GcrPromptDialog *self) | |
return; | |
} | |
- window = gtk_widget_get_window (GTK_WIDGET (self)); | |
- if (window == NULL) | |
- return; | |
+// window = gtk_widget_get_window (GTK_WIDGET (self)); | |
+// if (window == NULL) | |
+// return; | |
handle = g_ascii_strtoll (self->pv->caller_window, &end, 10); | |
if (!end || *end != '\0') { | |
@@ -147,15 +147,15 @@ update_transient_for (GcrPromptDialog *self) | |
return; | |
} | |
- display = gtk_widget_get_display (GTK_WIDGET (self)); | |
- transient_for = gdk_x11_window_foreign_new_for_display (display, (Window)handle); | |
- if (transient_for == NULL) { | |
- g_warning ("caller-window property doesn't represent a window on current display: %s", | |
- self->pv->caller_window); | |
- } else { | |
- gdk_window_set_transient_for (window, transient_for); | |
- g_object_unref (transient_for); | |
- } | |
+// display = gtk_widget_get_display (GTK_WIDGET (self)); | |
+// transient_for = gdk_x11_window_foreign_new_for_display (display, (Window)handle); | |
+// if (transient_for == NULL) { | |
+// g_warning ("caller-window property doesn't represent a window on current display: %s", | |
+// self->pv->caller_window); | |
+// } else { | |
+// gdk_window_set_transient_for (window, transient_for); | |
+// g_object_unref (transient_for); | |
+// } | |
gtk_window_set_modal (GTK_WINDOW (self), TRUE); | |
} | |
@@ -363,7 +363,7 @@ on_password_changed (GtkEditable *editable, | |
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (user_data), pwstrength); | |
} | |
- | |
+/* | |
static const gchar* | |
grab_status_message (GdkGrabStatus status) | |
{ | |
@@ -384,8 +384,9 @@ grab_status_message (GdkGrabStatus status) | |
return "unknown"; | |
} | |
} | |
+*/ | |
-static gboolean | |
+/*static gboolean | |
on_grab_broken (GtkWidget *widget, | |
GdkEventGrabBroken * event, | |
gpointer user_data) | |
@@ -393,7 +394,8 @@ on_grab_broken (GtkWidget *widget, | |
ungrab_keyboard (widget, (GdkEvent *)event, user_data); | |
return TRUE; | |
} | |
- | |
+*/ | |
+/* | |
static gboolean | |
grab_keyboard (GtkWidget *widget, | |
GdkEvent *event, | |
@@ -435,13 +437,13 @@ grab_keyboard (GtkWidget *widget, | |
gtk_device_grab_add (widget, device, TRUE); | |
self->pv->grabbed_device = device; | |
} else { | |
- g_message ("could not grab keyboard: %s", grab_status_message (status)); | |
+ g_message ("could not grab keyboard."); | |
} | |
/* Always return false, so event is handled elsewhere */ | |
- return FALSE; | |
-} | |
- | |
+// return FALSE; | |
+//} | |
+/* | |
static gboolean | |
ungrab_keyboard (GtkWidget *widget, | |
GdkEvent *event, | |
@@ -459,9 +461,9 @@ ungrab_keyboard (GtkWidget *widget, | |
} | |
/* Always return false, so event is handled elsewhere */ | |
- return FALSE; | |
-} | |
- | |
+ //return FALSE; | |
+//} | |
+/* | |
static gboolean | |
window_state_changed (GtkWidget *win, GdkEventWindowState *event, gpointer data) | |
{ | |
@@ -481,6 +483,7 @@ window_state_changed (GtkWidget *win, GdkEventWindowState *event, gpointer data) | |
return FALSE; | |
} | |
+*/ | |
static void | |
gcr_prompt_dialog_constructed (GObject *obj) | |
@@ -621,9 +624,9 @@ gcr_prompt_dialog_constructed (GObject *obj) | |
gtk_widget_show (GTK_WIDGET (grid)); | |
self->pv->widget_grid = GTK_WIDGET (grid); | |
- g_signal_connect (self, "map-event", G_CALLBACK (grab_keyboard), self); | |
- g_signal_connect (self, "unmap-event", G_CALLBACK (ungrab_keyboard), self); | |
- g_signal_connect (self, "window-state-event", G_CALLBACK (window_state_changed), self); | |
+// g_signal_connect (self, "map-event", G_CALLBACK (grab_keyboard), self); | |
+// g_signal_connect (self, "unmap-event", G_CALLBACK (ungrab_keyboard), self); | |
+// g_signal_connect (self, "window-state-event", G_CALLBACK (window_state_changed), self); | |
} | |
@@ -724,8 +727,8 @@ gcr_prompt_dialog_dispose (GObject *obj) | |
gcr_prompt_close (GCR_PROMPT (self)); | |
- ungrab_keyboard (GTK_WIDGET (self), NULL, self); | |
- g_assert (self->pv->grabbed_device == NULL); | |
+ //ungrab_keyboard (GTK_WIDGET (self), NULL, self); | |
+ //g_assert (self->pv->grabbed_device == NULL); | |
G_OBJECT_CLASS (gcr_prompt_dialog_parent_class)->dispose (obj); | |
} | |
diff --git a/ui/gcr-prompter-tool.c b/ui/gcr-prompter-tool.c | |
index 0a22238..d32b76a 100644 | |
--- a/ui/gcr-prompter-tool.c | |
+++ b/ui/gcr-prompter-tool.c | |
@@ -27,7 +27,7 @@ | |
#include <glib/gi18n.h> | |
#include <gtk/gtk.h> | |
-#include <gdk/gdkx.h> | |
+//#include <gdk/gdkx.h> | |
#include <pango/pango.h> | |
#include <locale.h> | |
-- | |
2.11.0 (Apple Git-81) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment