Comment 97 for bug 219385

Revision history for this message
In , Stransky (stransky) wrote :

Created attachment 557147
v2. nsWindow/gtk2compat.h patch

There's an updated patch for nsWindow and gtk2compat.h files. I hope I addressed all your comments, except:

>+#if defined(MOZ_WIDGET_GTK3) && !defined(MOZ_PLUGIN_GTK2)
>+#include <gtk/gtkx.h>
>+#endif
> #ifdef MOZ_X11
> #include <gdk/gdkx.h>

> Something is not right here with including gtkx.h twice.

They are two different headers, gdk/gdkx.h and gtk/gtkx.h.

>+static PRInt32
>+GetBitmapStride(PRInt32 width)
>+{
>+#ifdef MOZ_X11
>+ return (width+7)/8;
>+#else
>+ return cairo_format_stride_for_width(CAIRO_FORMAT_A1, width);
>+#endif
>+}

I keep here the logic from ApplyTransparencyBitmap() - MOZ_X11 and !MOZ_X11 && GTK2 uses (width+7)/8 and GTK3 calls cairo_format_stride_for_width(). But is it possible to build GTK2/GTK3 without MOZ_X11?

>@@ -3984,7 +4131,9 @@ nsWindow::Create(nsIWidget *aPare
> // WM_TAKE_FOCUS, focus is requested on the parent window.
> gtk_widget_realize(mShell);
>- gdk_window_add_filter(mShell->window,
>+#if defined(MOZ_WIDGET_GTK2) || defined(MOZ_PLUGIN_GTK2)
>+ gdk_window_add_filter(gtk_widget_get_window(mShell),
> popup_take_focus_filter, NULL);
> #endif
>+#endif

> Any reason why this should be disabled with GTK3 for now?

I disabled it in GTK3 because it's aimed to support plugins on GTK2.
Enabled now, we can support it in GTK3 too.

>@@ -6398,5 +6688,7 @@ void
> nsWindow::DispatchRestoreEventAccessible(void)
> {
>+#if defined(MOZ_WIDGET_GTK2) || defined(MOZ_PLUGIN_GTK2)
> DispatchEventToRootAccessible(nsIAccessibleEvent::EVENT_WINDOW_RESTORE);
>+#endif
> }
>

> I assume these are all TODO GTK3?

We disabled them because Gnome Shell does not handle these events nicely.
But let's enable it, there are other options than GS and they support them.