After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738887 - "Cannot commit NULL buffer to xdg_surface" error too pervasive
"Cannot commit NULL buffer to xdg_surface" error too pervasive
Status: RESOLVED NOTABUG
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-10-20 17:41 UTC by Carlos Garnacho
Modified: 2014-11-07 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Allow for wl_surface_commit()s before buffer existence (2.21 KB, patch)
2014-10-20 17:42 UTC, Carlos Garnacho
none Details | Review

Description Carlos Garnacho 2014-10-20 17:41:35 UTC
Currently this check is implemented in practice as "you must have a buffer right from the first wl_surface.commit". Due to this I'm finding hard/awkward to avoid situations in GTK+ if creating subsurface windows close to toplevel initialization (ie. when the toplevel has not yet a buffer), after the subsurface is positioned (for the first time in this case), a commit() on the parent surface is done if there was none yet. Because it didn't have a chance to draw yet, the buffer is NULL, getting then the error from mutter.

I suggest to relax a bit the requisitions during surface initialization, and only issue the error if a surface was ever set first and then unset. This makes it possible to have this kind of initialization commit()s while the buffer itself hasn't been initialized yet.
Comment 1 Carlos Garnacho 2014-10-20 17:42:52 UTC
Created attachment 288974 [details] [review]
wayland: Allow for wl_surface_commit()s before buffer existence

Right now the "Cannot commit NULL buffer to xdg_surface" error check
is too strict, failing just anytime a buffer is not attached.

Relax this a bit by allowing NULL buffers during initialization,
only as long as there was previously a NULL buffer. If a buffer
was set, and then unset, the error will be issued.
Comment 2 Carlos Garnacho 2014-11-07 16:32:30 UTC
I've pushed a fix in the GTK+ side for this, so this invariant is respected when committing parent-relative subsurface state.