The new header contains all state and event handling.
static gboolean cm_tree_button_release_event_cb(GtkWidget *widget, GdkEventButton *ev,
CookieManagerPage *cmp)
{
- if (ev->button == 3)
+ if (MIDORI_EVENT_CONTEXT_MENU(ev))
{
cm_tree_show_popup_menu(widget, ev, cmp);
return TRUE;
GdkEventButton* event)
{
/* Disable the popup menu */
- return (event->button == 3);
+ return MIDORI_EVENT_CONTEXT_MENU (event);
}
static gboolean
mouse_gesture_clear (gesture);
}
- if (event->button == 3)
+ if (MIDORI_EVENT_CONTEXT_MENU (event))
{
GtkWidget* menu = gtk_menu_new ();
midori_view_populate_popup (view, menu, TRUE);
GdkEventButton* event,
GtkWidget* view)
{
- if (event->button == 3)
+ if (MIDORI_EVENT_CONTEXT_MENU (event))
{
tab_panel_popup (GTK_WIDGET (toolitem), event, view);
return TRUE;
#include "midori-stock.h"
#include "midori-findbar.h"
#include "midori-transferbar.h"
+#include "midori-platform.h"
#include "gtkiconentry.h"
#include "marshal.h"
return TRUE;
}
- else if (event->type == GDK_BUTTON_PRESS && event->button == 3)
+ else if (event->type == GDK_BUTTON_PRESS && MIDORI_EVENT_CONTEXT_MENU (event))
{
GtkWidget* menu = gtk_menu_new ();
GList* tabs = gtk_container_get_children (GTK_CONTAINER (notebook));
return _action_navigation_activate (action, browser);
}
- else if (event->button == 3)
+ else if (MIDORI_EVENT_CONTEXT_MENU (event))
{
midori_browser_toolbar_popup_context_menu_cb (
GTK_IS_BIN (toolitem) && gtk_bin_get_child (GTK_BIN (toolitem)) ?
return TRUE;
}
}
- else if (event->button == 3)
+ else if (MIDORI_EVENT_CONTEXT_MENU (event))
{
midori_browser_bookmark_popup (toolitem, NULL, item, browser);
return TRUE;
#include "sokoke.h"
#include "midori-browser.h"
#include "midori-searchaction.h"
+#include "midori-platform.h"
#include <string.h>
#include <glib/gi18n.h>
--- /dev/null
+/*
+ Copyright (C) 2010-2011 Christian Dywan <christian@twotoasts.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ See the file COPYING for the full license text.
+*/
+
+#ifndef __MIDORI_PLATFORM_H__
+#define __MIDORI_PLATFORM_H__ 1
+
+#include <gtk/gtk.h>
+
+/* Common behavior modifiers */
+#define MIDORI_MOD_NEW_WINDOW(state) (state & GDK_SHIFT_MASK)
+#define MIDORI_MOD_NEW_TAB(state) (state & GDK_CONTROL_MASK)
+#define MIDORI_MOD_BACKGROUND(state) (state & GDK_SHIFT_MASK)
+#define MIDORI_MOD_SCROLL(state) (state & GDK_CONTROL_MASK)
+
+#ifdef GDK_WINDOWING_QUARTZ
+ #define MIDORI_EVENT_CONTEXT_MENU(evt) \
+ ((evt->button == 3) \
+ || (evt->button == 1 && (evt->state & GDK_CONTROL_MASK)))
+#else
+ #define MIDORI_EVENT_CONTEXT_MENU(evt) \
+ (evt->button == 3)
+#endif
+
+#endif /* !__MIDORI_PLATFORM_H__ */
#include "gtkiconentry.h"
#include "marshal.h"
#include "sokoke.h"
+#include "midori-platform.h"
#include <string.h>
#include <glib/gi18n.h>
#include "midori-stock.h"
#include "midori-browser.h"
#include "midori-searchaction.h"
+#include "midori-platform.h"
#include "marshal.h"
#include "sokoke.h"
gtk_widget_destroy (widget);
return TRUE;
}
- else if (event->button == 3)
+ else if (MIDORI_EVENT_CONTEXT_MENU (event))
{
/* Show a context menu on right click */
GtkWidget* menu = midori_view_get_tab_menu (MIDORI_VIEW (widget));
#include "midori-view.h"
#include "midori-viewable.h"
#include "midori-websettings.h"
+#include "midori-platform.h"
/* For convenience, include localization header */
#include <glib/gi18n-lib.h>
#ifndef __SOKOKE_H__
#define __SOKOKE_H__ 1
-/* Common behavior modifiers */
-#define MIDORI_MOD_NEW_WINDOW(state) (state & GDK_SHIFT_MASK)
-#define MIDORI_MOD_NEW_TAB(state) (state & GDK_CONTROL_MASK)
-#define MIDORI_MOD_BACKGROUND(state) (state & GDK_SHIFT_MASK)
-#define MIDORI_MOD_SCROLL(state) (state & GDK_CONTROL_MASK)
-
#include <JavaScriptCore/JavaScript.h>
#include <midori/midori-websettings.h>