Closed Bug 1667851 Opened 4 years ago Closed 3 years ago

[wayland] firefox flickers when opened

Categories

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

Firefox 81
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: Turanomario, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(5 files, 4 obsolete files)

454.57 KB, video/webm
Details
27.69 KB, text/plain
Details
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

Steps to reproduce:

Firefox 81
Fedora Linux x86_64
Gnome 3.38
Wayland 1.18
HW: intel i5 5300U (GPU intel HD4000)
libva 1.7 Intel iHD driver (iHD_drv_video.so)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Graphics
Product: Firefox → Core

Could you attach your about:support? Thanks!

Flags: needinfo?(Turanomario)
Severity: -- → S3
OS: Unspecified → Linux
Hardware: Unspecified → Desktop

This is caused by wrong wl_subsurface position after FF start. I wonder if we fails to sync the surface or the invalidate on Gtk side is not called soon enough.

Assignee: nobody → stransky
Component: Graphics → Widget: Gtk
Priority: -- → P2
Flags: needinfo?(Turanomario)

I can reproduce that locally.

Rework wl_subsurface creation in these steps:

  1. moz_container_wayland_size_allocate() handler is called when
    mContainer size/position is known.
    It calls moz_container_wayland_surface_create_locked(), registers
    a frame callback handler
    (moz_container_wayland_frame_callback_handler()).

  2. moz_container_wayland_frame_callback_handler() is called
    when wl_surface owned by mozContainer is ready.
    We call initial_draw_cbs() handler and we can create our wl_subsurface
    on top of wl_surface owned by mozContainer.

Also size wl_buffer at WindowSurfaceWayland according to mozcontainer size,
don't use nsWindow bounds for it.

  • Try to set subsurface offset even if we mozcontainer size allocation is not finished. Use window decoration size for it.
  • Add more logging to mozcontainer code.

Depends on D103942

  • Try to set subsurface offset even if we mozcontainer size allocation is not finished. Use window decoration size for it.
  • Add more logging to mozcontainer code.

Depends on D103942

Attachment #9201745 - Attachment is obsolete: true
  • Recently we use size allocation event to create wl_subsurface of MozContainer. Unfortunately size allocation event
    is not called when a window is opened second time, as its size is already set. Use map_event to create
    wl_subsurface in this case.
Attachment #9201745 - Attachment is obsolete: false
Attachment #9201743 - Attachment is obsolete: true
Attachment #9200960 - Attachment is obsolete: true
Attachment #9201745 - Attachment is obsolete: true
Attachment #9201746 - Attachment is obsolete: true

Rework wl_subsurface creation in these steps:

  1. moz_container_wayland_size_allocate() handler is called when
    mContainer size/position is known.
    It calls moz_container_wayland_surface_create_locked(), registers
    a frame callback handler
    (moz_container_wayland_frame_callback_handler()).

  2. moz_container_wayland_frame_callback_handler() is called
    when wl_surface owned by mozContainer is ready.
    We call initial_draw_cbs() handler and we can create our wl_subsurface
    on top of wl_surface owned by mozContainer.

Also size wl_buffer at WindowSurfaceWayland according to mozcontainer size,
don't use nsWindow bounds for it.

  • Try to set subsurface offset even if we mozcontainer size allocation is not finished. Use window decoration size for it.
  • Add more logging to mozcontainer code.

Depends on D104549

  • Recently we use size allocation event to create wl_subsurface of MozContainer. Unfortunately size allocation event
    is not called when a window is opened second time, as its size is already set. Use map_event to create
    wl_subsurface in this case.

Depends on D104550

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/8a5f4c0386c2
[Wayland] Rework mozcontainer wl_subsurface creation, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/9aefa43b4688
[Wayland] Guess subsurface offset from window decorations size, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/8446b26d9c1d
[Wayland] Use map_event to create wl_subsurface of MozContainer when it's size is already allocated, r=jhorak

Backed out for causing build bustage on WindowSurfaceWayland.cpp

backout: https://hg.mozilla.org/integration/autoland/rev/5d5111ad0d7b587db17801c1e82bd83798b62f82

push: https://treeherder.mozilla.org/jobs?repo=autoland&revision=8446b26d9c1d4015eba463a1ca3925fbbb288a40&group_state=expanded&selectedTaskRun=SUeXnZVhRQqSJGQoBAZohA.0

failure log: https://treeherder.mozilla.org/logviewer?job_id=329403033&repo=autoland&lineNumber=29973

[task 2021-02-09T20:11:28.314Z] 20:11:28 INFO - In file included from Unified_cpp_widget_gtk1.cpp:20:
[task 2021-02-09T20:11:28.315Z] 20:11:28 ERROR - /builds/worker/checkouts/gecko/widget/gtk/WindowSurfaceWayland.cpp:1018:10: error: data argument not used by format string [-Werror,-Wformat-extra-args]
[task 2021-02-09T20:11:28.315Z] 20:11:28 INFO - (void*)this));
[task 2021-02-09T20:11:28.315Z] 20:11:28 INFO - ^
[task 2021-02-09T20:11:28.315Z] 20:11:28 INFO - /builds/worker/checkouts/gecko/widget/gtk/WindowSurfaceWayland.cpp:31:58: note: expanded from macro 'LOGWAYLAND'
[task 2021-02-09T20:11:28.316Z] 20:11:28 INFO - MOZ_LOG(gWidgetWaylandLog, mozilla::LogLevel::Debug, args)
[task 2021-02-09T20:11:28.316Z] 20:11:28 INFO - ^~~~
[task 2021-02-09T20:11:28.316Z] 20:11:28 INFO - /builds/worker/workspace/obj-build/dist/include/mozilla/Logging.h:284:56: note: expanded from macro 'MOZ_LOG'
[task 2021-02-09T20:11:28.317Z] 20:11:28 INFO - MOZ_LOG_EXPAND_ARGS _args);
[task 2021-02-09T20:11:28.318Z] 20:11:28 INFO - ^~~~~
[task 2021-02-09T20:11:28.318Z] 20:11:28 INFO - /builds/worker/workspace/obj-build/dist/include/mozilla/Logging.h:221:34: note: expanded from macro 'MOZ_LOG_EXPAND_ARGS'
[task 2021-02-09T20:11:28.318Z] 20:11:28 INFO - #define MOZ_LOG_EXPAND_ARGS(...) VA_ARGS
[task 2021-02-09T20:11:28.318Z] 20:11:28 INFO - ^~~~~~~~~~~
[task 2021-02-09T20:11:28.318Z] 20:11:28 INFO - 1 error generated.
[task 2021-02-09T20:11:28.319Z] 20:11:28 INFO - /builds/worker/checkouts/gecko/config/rules.mk:674: recipe for target 'Unified_cpp_widget_gtk1.o' failed

Flags: needinfo?(stransky)

Updated, Thanks.

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/068c880bac2f
[Wayland] Rework mozcontainer wl_subsurface creation, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/239817dfb372
[Wayland] Guess subsurface offset from window decorations size, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/e1e5bb1b3ccf
[Wayland] Use map_event to create wl_subsurface of MozContainer when it's size is already allocated, r=jhorak
Regressions: 1693317
Regressions: 1694967
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: