Fix a memory leak reported by Valgrind, by destroying the window
decorations widget, if it exists.
All widget pointers returned from toytoolkit to the application should
be destroyed by the application explicitly.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
When we destroy a surface, we damage the surface below so that the area
exposed by the disappearing surface will be repainted. However, if that
surface also is destroyed, the damage information is lost and we fail to
repaint that area.
This commit introduces weston_surface_flush_damage(), which flushes the
surface damage the the surface below when a surface is destroyed. When
multiple surfaces are destroyed at the same time, the damage now accumulates
and sinks down through the surface stack as it should.
gbm_bo_create_from_egl_image() should catch this based on the
GBM_BO_USE_CURSOR_64X64 flag. It currently doesn't so we end up with
a cursor buffer with invalid stride.
The decorations were not responding, could not move or resize the
dialog, and it painted with a black shade.
When the dialog is created, schedule a resize instead of a repaint. The
resize will initialise the widget tree, and let everything draw and work
as it should.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
If we don't cancel the repaint, we end up pointlessly redrawing the output.
What's worse is that pageflipping to the new buffer eventually fails and
we miss the finish_frame callback, leaving the compositor stuck when we
re-enter the vt.
Normally the repaint will trigger a pageflip, which flips back to our
fb, but that doesn't work if the kms output has been turned off or
set to a different mode.
In the great toytoolkit widget revolution, wscreensaver demo mode lost
its window decorations. Bring them back.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
If the desktop-shell client goes away for any reason, respawn it. To
avoid harmful looping, limit the respawning to 5 times within 30
seconds, and then give up.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This is typically when launcing from a pty such as an X (or Wayland)
terminal or from an ssh session. Opening a new vt typically requires root
priviledges, so weston must be setuid root or laucnhed as root for this
to work.
Fixes the following build failure:
In file included from window.c:58:0:
window.h:194:16: error: redefinition of typedef 'widget_resize_handler_t'
window.h:178:16: note: previous declaration of 'widget_resize_handler_t' was here
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
We can only set up once we've acquired the VT and we shouldn't release the
VT until we've cleaned up. Before we would release the VT first, and then
race to drop drm master as X tried to get drm master. Which would kill X.
Part of the point of KD_GRAPHICS mode is that the kernel doesn't try
to restore the VT contents when we switch bach, but leaves that
to the user mode process. This avoids ugly flicker of text mode contents
before the compositor takes over.
With all input events going to widgets now, we can grab an input device
to a widget, so that all events are delivered to that widgets handlers.
This lets us implement the last bit of the menu behaviour, that is
the client side grabbing of events. The result is that we can now pop down
the menu when we receive clicks in the clients own windows and we
don't send motion and button events to other widgets.