This fixes crashes caused by popup windows that don't have override_redirect
(e.g., menus in VLC and KDE apps).
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Fixes a crash caused by accessing a deleted view in weston_wm_window_schedule_repaint. It can be easily reproduced by switching between menus in Firefox.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
The logic here broke at some point so that we would only update the
input region for non-fullscreen windows. Thus, a fullscreen window would
be stuck with whatever size the most recent non-fullscreen size was.
https://bugs.freedesktop.org/show_bug.cgi?id=69219
The weston_surface structure is split into two structures:
* The weston_surface structure storres everything required for a
client-side or server-side surface. This includes buffers; callbacks;
backend private data; input, damage, and opaque regions; and a few other
bookkeeping bits.
* The weston_view structure represents an entity in the scenegraph and
storres all of the geometry information. This includes clip region,
alpha, position, and the transformation list as well as all of the
temporary information derived from the geometry state. Because a view,
and not a surface, is a scenegraph element, the view is what is placed
in layers and planes.
There are a few things worth noting about the surface/view split:
1. This is *not* a modification to the protocol. It is, instead, a
modification to Weston's internal scenegraph to allow a single surface
to exist in multiple places at a time. Clients are completely unaware
of how many views to a particular surface exist.
2. A view is considered a direct child of a surface and is destroyed when
the surface is destroyed. Because of this, the view.surface pointer is
always valid and non-null.
3. The compositor's surface_list is replaced with a view_list. Due to
subsurfaces, building the view list is a little more complicated than
it used to be and involves building a tree of views on the fly whenever
subsurfaces are used. However, this means that backends can remain
completely subsurface-agnostic.
4. Surfaces and views both keep track of which outputs they are on.
5. The weston_surface structure now has width and height fields. These
are populated when a new buffer is attached before surface.configure
is called. This is because there are many surface-based operations
that really require the width and height and digging through the views
didn't work well.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
We get the child position but never use this information here. Just remove it.
Spotted by Christopher Michael.
Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
the unmap event will be followed by the deletion of the weston_surface,
so the shell_surface will also be deleted by the shell. Having removed
the surface_destroy_listener, the surface_destroy callback doesn't
get called, so reset the value of shsurf here.
We used to destroy the frame window and reparent the client window to
wm_window. That means that we lose the destroy_notify event when the
client window is destroyed later, since we don't select for
substructure_notify on wm_window.
Instead of destroying and reparenting, just unmap the frame window.
window->x/y is the coordinate of the top-level surface (whether that's
the frame window or an override-redirect window) and the wayland surface
should be placed there, without the t->margin offset.
The coordinate transformation was broken (worked for first output where
output->x/y was 0,0, broke on all other outputs). We can just use
surface->geometry.x/y directly. We can't use the full transformation,
the best we can do is to move the X window to the geometry.x/y location.
Get rid of the static old_sx/sy hack as well.
We only get configure notify for toplevel (frame or override-redirect window)
and those are the cases where we want to update window->x/y. The way the
code worked, we'd exit immeidately in those cases and window->x/y would
not be updated.
We can get a destroy notify for the frame window after we've removed it
from the hash table. This turns into a NULL pointer deref when we look up
the window and try to use it for debugging printout.
Fixes the failing xwayland test case.
Window contents cannot be assumed to be fully opaque for windows drawn with
a RGBA visual. The optimization of setting a full opaque region is limited to
windows with a color depth != 32.
xeyes works as expected now. subwindows are popped also as expected. This
patch should fix the following:
https://bugs.freedesktop.org/show_bug.cgi?id=59983
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
When printing debug information about atoms, the XWM would crash if the X
server failed to respond to a request about atom names. In practice this
occurred when the server itself crashed, e.g. when starting mplayer with the
"xv" vo.
This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series. I am sending this one out ahead of the rest for review.
Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully. Could someone please test with XWayland and let
me know if this causes problems?
Because a surface may be created from XWayland, the resource may not always
exist. Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system. This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.
Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries. This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
[pq: rebased and converted more files]
struct weston_surface is now the only surface type we have (in core, shell.c
has shell_surface, of course). A lot of code gets simpler and we never
have to try to guess whether an API takes a wl_surface or a weston_surface.
We used to rely on an ugly hack where the xwayland server would always
report RGB X windows as having ARGB pixels, so that texturing from these
would also sample the undefined alpha. We also relied on Xrender rendering
to RGB X windows to write the alpha channel correctly, so that when we
texture from the RGB X window as an ARGB surface we end up getting the
alpha written by Xrender.
That was obviously all broken. We can instead reparent client windows into
ARGB frame windows. That way we can render the decorations using a
ARGB render pictformat and sample back those alpha values in a well-defined
way. We can also unbreak xwayland and let it report RGB pixel format for
RGB windows. We still need the opaque region or the RGB-only client window
but that's OK.
Instead of directly setting the dirty flag on weston_surface geometry,
use a function for that.
This allows us to hook into geometry dirtying in a following patch.
Also add comments to weston_surface fields, whose modification causes
transform state to become outdated.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
If we get a fullscreen client message before we map the window, we don't
have a shell surface yet. Just dont call set_fullscreen yet, and rely on
xserver_map_shell_surface() to fullscreen it when we map it.
We were setting up the opaque region to be the window size and then
intersecting with the opaque rectange that's always contained in the window
rectangle. Just initialize to the opaque rectangle.
This must be the last regression from the surface commit changes. We
need to set the pending.input region, otherwise the region will be
overwritten on commit.
https://bugs.freedesktop.org/show_bug.cgi?id=60610
We can now handle fullscreen X windows. X clients request to go fullscreen
buy sending a _NET_WM_STATE client message to the root window. When that
happens we call into the shell interface and asks the shell to make the
surface fullscreen. The shell will then resize the window, which causes
the X wm to configure the X window appropriately.
Make sure we ignore configure requests from fullscreened clients and send out
the synthetic configure notify as required in that case.
Finally, inspect _NET_WM_STATE before mapping so we can handle initial
fullscreen correctly.
In particular if the hash table lookup fails and returns NULL then that value
would be passed into weston_wm_window_schedule_repaint which does not accept a
NULL value.
It's pure WM-related function, so use the same 'weston_wm_' prefix that others
in the same file are already using.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Since surface.commit was introduced, opqaue regions are stored in a pending
variable that isn't used until surface.commit. Xwayland uses the surface opaque
region as a way to tell weston what region of the surface should be opaque.
However when this pending opaque region was introduced, xwm was not updated
and so we have the 'black = transparent' problem again. This patch fixes the
problem by having xwm use the pending opaque regions.