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.
Created attachment 557147 gtk2compat. h patch
v2. nsWindow/
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 de(PRInt32 width) stride_ for_width( CAIRO_FORMAT_ A1, width);
>+GetBitmapStri
>+{
>+#ifdef MOZ_X11
>+ return (width+7)/8;
>+#else
>+ return cairo_format_
>+#endif
>+}
I keep here the logic from ApplyTransparen cyBitmap( ) - 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 realize( mShell) ; add_filter( mShell- >window, MOZ_WIDGET_ GTK2) || defined( MOZ_PLUGIN_ GTK2) add_filter( gtk_widget_ get_window( mShell) , focus_filter, NULL);
> // WM_TAKE_FOCUS, focus is requested on the parent window.
> gtk_widget_
>- gdk_window_
>+#if defined(
>+ gdk_window_
> popup_take_
> #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 :DispatchRestor eEventAccessibl e(void) MOZ_WIDGET_ GTK2) || defined( MOZ_PLUGIN_ GTK2) RootAccessible( nsIAccessibleEv ent::EVENT_ WINDOW_ RESTORE) ;
> nsWindow:
> {
>+#if defined(
> DispatchEventTo
>+#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.