diff --git a/configure.in b/configure.in index 189b8ef3f5e8..a9cbb1be477a 100644 --- a/configure.in +++ b/configure.in @@ -2733,6 +2733,7 @@ gtk) gtk2) MOZ_ENABLE_GTK2=1 + MOZ_ENABLE_XREMOTE=1 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)' TK_LIBS='$(MOZ_GTK2_LIBS)' AC_DEFINE(MOZ_WIDGET_GTK2) diff --git a/widget/src/gtk2/Makefile.in b/widget/src/gtk2/Makefile.in index 37fedbe442cd..2074394fbb70 100644 --- a/widget/src/gtk2/Makefile.in +++ b/widget/src/gtk2/Makefile.in @@ -37,7 +37,8 @@ REQUIRES = xpcom \ string \ gfx \ dom \ - accessibility + accessibility \ + xremoteservice CSRCS = \ mozcontainer.c \ @@ -55,6 +56,7 @@ CPPSRCS = \ nsCommonWidget.cpp \ nsLookAndFeel.cpp \ nsGtkKeyUtils.cpp \ + nsGtkMozRemoteHelper.cpp \ $(NULL) SHARED_LIBRARY_LIBS = $(DIST)/lib/libxpwidgets_s.a diff --git a/widget/src/gtk2/nsWidgetFactory.cpp b/widget/src/gtk2/nsWidgetFactory.cpp index a83c3641f769..13b89023f902 100644 --- a/widget/src/gtk2/nsWidgetFactory.cpp +++ b/widget/src/gtk2/nsWidgetFactory.cpp @@ -43,6 +43,7 @@ #include "nsLookAndFeel.h" #include "nsWindow.h" #include "nsScrollbar.h" +#include "nsGtkMozRemoteHelper.h" #ifdef IBMBIDI #include "nsBidiKeyboard.h" #endif @@ -52,6 +53,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShell) NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsGtkXRemoteWidgetHelper) static nsresult nsHorizScrollbarConstructor (nsISupports *aOuter, @@ -137,6 +139,10 @@ static const nsModuleComponentInfo components[] = NS_VERTSCROLLBAR_CID, "@mozilla.org/widgets/vertscroll/gtk;1", nsVertScrollbarConstructor }, + { NS_IXREMOTEWIDGETHELPER_CLASSNAME, + NS_GTKXREMOTEWIDGETHELPER_CID, + NS_IXREMOTEWIDGETHELPER_CONTRACTID, + nsGtkXRemoteWidgetHelperConstructor }, #ifdef IBMBIDI { "Gtk2 Bidi Keyboard", NS_BIDIKEYBOARD_CID, diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 7c6c5363cc3a..380cf90b8e5e 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -45,6 +45,7 @@ #include "nsGtkKeyUtils.h" #include "nsGtkCursors.h" +#include "nsGtkMozRemoteHelper.h" #include #include @@ -95,6 +96,8 @@ static gboolean visibility_notify_event_cb(GtkWidget *widget, GdkEventVisibility *event); static gboolean window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event); +static gboolean property_notify_event_cb (GtkWidget *widget, + GdkEventProperty *event); static PRBool gJustGotActivate = PR_FALSE; nsCOMPtr gRollupListener; @@ -1432,9 +1435,11 @@ nsWindow::NativeCreate(nsIWidget *aParent, // we need to add this to the shell since versions of gtk // before 2.0.3 forgot to set property_notify events on the // shell window - gtk_widget_add_events(mShell, GDK_PROPERTY_NOTIFY); + gtk_widget_add_events(mShell, GDK_PROPERTY_CHANGE_MASK); g_signal_connect(G_OBJECT(mShell), "window_state_event", G_CALLBACK(window_state_event_cb), NULL); + g_signal_connect(G_OBJECT(mShell), "property_notify_event", + G_CALLBACK(property_notify_event_cb), NULL); } if (mContainer) { @@ -2215,6 +2220,19 @@ window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event) return FALSE; } +/* static */ +gboolean +property_notify_event_cb (GtkWidget *widget, GdkEventProperty *event) +{ + nsIWidget *nswidget = (nsIWidget *)get_window_for_gtk_widget(widget); + if (!nswidget) + return FALSE; + + nsGtkMozRemoteHelper::HandlePropertyChange(widget, event, nswidget); + + return FALSE; +} + #ifdef ACCESSIBILITY /** * void