Closed Bug 1425841 Opened 7 years ago Closed 7 years ago

[Wayland] - Various nsWindow tweaks

Categories

(Core :: Widget: Gtk, enhancement, P2)

All
Linux
enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

nsWindow module needs various tweaks to run under Wayland.
Comment on attachment 8937448 [details]
Bug 1425841 - don't call gdk_x11_window_get_xid() at LOG() on Wayland,

https://reviewboard.mozilla.org/r/208106/#review214804
Attachment #8937448 - Flags: review?(jhorak) → review+
Comment on attachment 8937449 [details]
Bug 1425841 - Implement GetWaylandDisplay() and GetWaylandSurface() needed by WindowSurfaceWayland,

https://reviewboard.mozilla.org/r/208108/#review214806
Attachment #8937449 - Flags: review?(jhorak) → review+
Comment on attachment 8937450 [details]
Bug 1425841 - Handle NS_NATIVE_DISPLAY/NS_NATIVE_SHAREABLE_WINDOW request on Wayland,

https://reviewboard.mozilla.org/r/208110/#review214810

::: widget/gtk/nsWindow.cpp:1727
(Diff revision 1)
>      }
>      case NS_NATIVE_SHELLWIDGET:
>          return GetToplevelWidget();
>  
>      case NS_NATIVE_SHAREABLE_WINDOW:
> -        return (void *) GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow));
> +        return mIsX11Display ?

Please add a NS_WARNING that it is not implemented in Wayland.
Attachment #8937450 - Flags: review?(jhorak) → review+
Comment on attachment 8937451 [details]
Bug 1425841 - Don't install popup_take_focus_filter on Wayland as it's X11 only,

https://reviewboard.mozilla.org/r/208112/#review214814
Attachment #8937451 - Flags: review?(jhorak) → review+
Comment on attachment 8937452 [details]
Bug 1425841 - Set up nsWindow configuration for Wayland rendering,

https://reviewboard.mozilla.org/r/208114/#review214826

::: widget/gtk/nsWindow.cpp:3668
(Diff revision 3)
> -        // window manager, as indicated by GTK_WINDOW_TOPLEVEL ...
> +        // window manager, as indicated by GTK_WINDOW_TOPLEVEL.
> +        // For Wayland we have to always use GTK_WINDOW_POPUP to control
> +        // window position.
>          GtkWindowType type =
> -            mWindowType != eWindowType_popup || aInitData->mNoAutoHide ?
> +            mWindowType != eWindowType_popup ||
> +            (aInitData->mNoAutoHide && mIsX11Display) ?

This is maybe too complicated to read, better:

GtkWindowType type = GTK_WINDOW_TOPLEVEL;
if (mIsX11Display && (mWindowType != eWindowType_popup || aInitData->mNoAutoHide))
  type = GTK_WINDOW_POPUP;
Attachment #8937452 - Flags: review?(jhorak) → review+
Comment on attachment 8937452 [details]
Bug 1425841 - Set up nsWindow configuration for Wayland rendering,

https://reviewboard.mozilla.org/r/208114/#review214826

> This is maybe too complicated to read, better:
> 
> GtkWindowType type = GTK_WINDOW_TOPLEVEL;
> if (mIsX11Display && (mWindowType != eWindowType_popup || aInitData->mNoAutoHide))
>   type = GTK_WINDOW_POPUP;

I'd go with:

       GtkWindowType type = GTK_WINDOW_TOPLEVEL;
       if (mWindowType == eWindowType_popup) {
           type = mIsX11Display && aInitData->mNoAutoHide ?
               GTK_WINDOW_TOPLEVEL : GTK_WINDOW_POPUP;
        }
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/6f1f9f585d3a
don't call gdk_x11_window_get_xid() at LOG() on Wayland, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/8f0367c9a53a
Implement GetWaylandDisplay() and GetWaylandSurface() needed by WindowSurfaceWayland, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/b5e9d1d99050
Handle NS_NATIVE_DISPLAY/NS_NATIVE_SHAREABLE_WINDOW request on Wayland, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/b7eb10389dae
Don't install popup_take_focus_filter on Wayland as it's X11 only, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/61006be16563
Set up nsWindow configuration for Wayland rendering, r=jhorak
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: