зеркало из https://github.com/mozilla/pjs.git
Temporarily back out theme change support (238854) until I can get a good fix for the crashes.
This commit is contained in:
Родитель
d788093faa
Коммит
7e63e2d295
|
@ -226,8 +226,6 @@ moz_container_init (MozContainer *container)
|
|||
backend so for widgets we just use that colormap instead of the
|
||||
default one. */
|
||||
gtk_widget_set_colormap(GTK_WIDGET(container), gdk_rgb_get_colormap());
|
||||
|
||||
container->drawing_areas = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -446,23 +444,3 @@ moz_container_add(GtkContainer *container, GtkWidget *widget)
|
|||
moz_container_put(MOZ_CONTAINER(container), widget, 0, 0);
|
||||
}
|
||||
|
||||
GSList*
|
||||
moz_container_get_drawing_areas (MozContainer *container)
|
||||
{
|
||||
return container->drawing_areas;
|
||||
}
|
||||
|
||||
void
|
||||
moz_container_add_drawing_area (MozContainer *container,
|
||||
struct _MozDrawingarea *area)
|
||||
{
|
||||
container->drawing_areas = g_slist_prepend (container->drawing_areas,
|
||||
area);
|
||||
}
|
||||
|
||||
void
|
||||
moz_container_remove_drawing_area (MozContainer *container,
|
||||
struct _MozDrawingarea *area)
|
||||
{
|
||||
container->drawing_areas = g_slist_remove (container->drawing_areas, area);
|
||||
}
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
|
||||
#include <gtk/gtkcontainer.h>
|
||||
|
||||
struct _MozDrawingarea;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
@ -61,7 +59,6 @@ struct _MozContainer
|
|||
{
|
||||
GtkContainer container;
|
||||
GList *children;
|
||||
GSList *drawing_areas;
|
||||
};
|
||||
|
||||
struct _MozContainerClass
|
||||
|
@ -85,11 +82,7 @@ void moz_container_scroll_update (MozContainer *container,
|
|||
GtkWidget *child_widget,
|
||||
gint x,
|
||||
gint y);
|
||||
GSList* moz_container_get_drawing_areas (MozContainer *container);
|
||||
void moz_container_add_drawing_area (MozContainer *container,
|
||||
struct _MozDrawingarea *area);
|
||||
void moz_container_remove_drawing_area (MozContainer *container,
|
||||
struct _MozDrawingarea *area);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -87,8 +87,6 @@ moz_drawingarea_new (MozDrawingarea *parent, MozContainer *widget_parent)
|
|||
|
||||
drawingarea->parent = parent;
|
||||
|
||||
moz_container_add_drawing_area(widget_parent, drawingarea);
|
||||
|
||||
if (!parent)
|
||||
moz_drawingarea_create_windows(drawingarea,
|
||||
GTK_WIDGET(widget_parent)->window,
|
||||
|
@ -165,16 +163,11 @@ void
|
|||
moz_drawingarea_finalize (GObject *object)
|
||||
{
|
||||
MozDrawingarea *drawingarea;
|
||||
MozContainer *container;
|
||||
|
||||
g_return_if_fail(IS_MOZ_DRAWINGAREA(object));
|
||||
|
||||
drawingarea = MOZ_DRAWINGAREA(object);
|
||||
|
||||
gdk_window_get_user_data(drawingarea->clip_window, &container);
|
||||
g_return_if_fail(IS_MOZ_CONTAINER(container));
|
||||
|
||||
moz_container_remove_drawing_area(container, drawingarea);
|
||||
gdk_window_destroy(drawingarea->inner_window);
|
||||
gdk_window_destroy(drawingarea->clip_window);
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@ static gboolean window_state_event_cb (GtkWidget *widget,
|
|||
GdkEventWindowState *event);
|
||||
static gboolean property_notify_event_cb (GtkWidget *widget,
|
||||
GdkEventProperty *event);
|
||||
static gboolean client_event_cb (GtkWidget *widget,
|
||||
GdkEventClient *event);
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
@ -386,11 +384,6 @@ nsWindow::Destroy(void)
|
|||
// window this isn't going to harm anything.
|
||||
mWindowGroup = nsnull;
|
||||
|
||||
if (mDrawingarea) {
|
||||
g_object_unref(mDrawingarea);
|
||||
mDrawingarea = nsnull;
|
||||
}
|
||||
|
||||
if (mShell) {
|
||||
gtk_widget_destroy(mShell);
|
||||
mShell = nsnull;
|
||||
|
@ -401,6 +394,11 @@ nsWindow::Destroy(void)
|
|||
mContainer = nsnull;
|
||||
}
|
||||
|
||||
if (mDrawingarea) {
|
||||
g_object_unref(mDrawingarea);
|
||||
mDrawingarea = nsnull;
|
||||
}
|
||||
|
||||
OnDestroy();
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
|
@ -1715,57 +1713,6 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent)
|
|||
DispatchEvent(&event, status);
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::OnClientEvent(GtkWidget *aWidget, GdkEventClient *aEvent)
|
||||
{
|
||||
static GdkAtom atom_rcfiles = GDK_NONE;
|
||||
if (!atom_rcfiles)
|
||||
atom_rcfiles = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
|
||||
|
||||
if (aEvent->message_type == atom_rcfiles)
|
||||
ThemeChanged();
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::ThemeChanged()
|
||||
{
|
||||
nsGUIEvent event(NS_THEMECHANGED, this);
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
DispatchEvent(&event, status);
|
||||
|
||||
if (mContainer) {
|
||||
// Dispatch NS_THEMECHANGED to all child windows
|
||||
GSList *areas = moz_container_get_drawing_areas(mContainer);
|
||||
while (areas) {
|
||||
MozDrawingarea *area = MOZ_DRAWINGAREA(areas->data);
|
||||
nsWindow *win;
|
||||
|
||||
win = (nsWindow*)g_object_get_data(G_OBJECT(area->clip_window),
|
||||
"nsWindow");
|
||||
|
||||
nsGUIEvent event(NS_THEMECHANGED, win);
|
||||
status = nsEventStatus_eIgnore;
|
||||
win->DispatchEvent(&event, status);
|
||||
|
||||
areas = areas->next;
|
||||
}
|
||||
|
||||
// Child containers are handled recursively
|
||||
GList *children = mContainer->children;
|
||||
while (children) {
|
||||
if (IS_MOZ_CONTAINER(children->data)) {
|
||||
nsWindow *win =
|
||||
(nsWindow*) g_object_get_data(G_OBJECT(children->data),
|
||||
"nsWindow");
|
||||
|
||||
win->ThemeChanged();
|
||||
}
|
||||
|
||||
children = children->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
nsWindow::OnDragMotionEvent(GtkWidget *aWidget,
|
||||
GdkDragContext *aDragContext,
|
||||
|
@ -2255,8 +2202,6 @@ nsWindow::NativeCreate(nsIWidget *aParent,
|
|||
G_CALLBACK(window_state_event_cb), NULL);
|
||||
g_signal_connect(G_OBJECT(mShell), "property_notify_event",
|
||||
G_CALLBACK(property_notify_event_cb), NULL);
|
||||
g_signal_connect(G_OBJECT(mShell), "client_event",
|
||||
G_CALLBACK(client_event_cb), NULL);
|
||||
}
|
||||
|
||||
if (mContainer) {
|
||||
|
@ -3507,19 +3452,6 @@ property_notify_event_cb (GtkWidget *widget, GdkEventProperty *event)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* static */
|
||||
gboolean
|
||||
client_event_cb (GtkWidget *widget, GdkEventClient *event)
|
||||
{
|
||||
nsWindow *window = get_window_for_gtk_widget(widget);
|
||||
if (!window)
|
||||
return FALSE;
|
||||
|
||||
window->OnClientEvent(widget, event);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// These are all of our drag and drop operations
|
||||
|
||||
|
|
|
@ -182,8 +182,6 @@ public:
|
|||
GdkEventVisibility *aEvent);
|
||||
void OnWindowStateEvent(GtkWidget *aWidget,
|
||||
GdkEventWindowState *aEvent);
|
||||
void OnClientEvent(GtkWidget *aWidget,
|
||||
GdkEventClient *aEvent);
|
||||
gboolean OnDragMotionEvent(GtkWidget *aWidget,
|
||||
GdkDragContext *aDragContext,
|
||||
gint aX,
|
||||
|
@ -248,8 +246,6 @@ public:
|
|||
void SetNonXEmbedPluginFocus(void);
|
||||
void LoseNonXEmbedPluginFocus(void);
|
||||
|
||||
void ThemeChanged(void);
|
||||
|
||||
Window mOldFocusWindow;
|
||||
|
||||
static guint32 mLastButtonPressTime;
|
||||
|
|
Загрузка…
Ссылка в новой задаче