Bug #121255. Hook up gtk2 to xremote. r=cls on the configure.in change

This commit is contained in:
blizzard%redhat.com 2002-05-12 21:03:17 +00:00
Родитель 61da10a55a
Коммит f5d6b583a2
4 изменённых файлов: 29 добавлений и 2 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -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,

Просмотреть файл

@ -45,6 +45,7 @@
#include "nsGtkKeyUtils.h"
#include "nsGtkCursors.h"
#include "nsGtkMozRemoteHelper.h"
#include <gtk/gtkwindow.h>
#include <gdk/gdkx.h>
@ -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 <nsIRollupListener> 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