Commit Graph

3883 Commits

Author SHA1 Message Date
Kristian Høgsberg
239902b323 client: Fix shell unstable version check
Use a static assert to catch mismatch between implementation and
interface version.  Fix window.c to not use XDG_SHELL_VERSION_CURRENT,
which will fail to catch version mismatches.  The implementation version
must updated manually when the implementation is updated to use the new
interface.
2014-02-11 16:22:10 -08:00
Kristian Høgsberg
2bff94e057 xdg-shell: Move "ping" and "pong" to xdg_shell, not xdg_surface
Responsivenes is a per-client thing so we move the ping/pong functionality
to xdg_shell.  Having this per-window was carries over from the EWMH
protocol, where the WM has no other way to do this.  In wayland, the
compositor can directly ping the client that owns the surface.
2014-02-11 16:22:10 -08:00
Mariusz Ceier
cbb9158162 Don't crash when eglCreateContext fails
eglCreateContext fails with every EGLConfig that
nvidia blob 334.16 provides causing NULL pointer
dereference in gl_renderer_destroy when destroying
fragment and fan bindings.

https://bugs.freedesktop.org/show_bug.cgi?id=74699

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
2014-02-09 21:38:03 -08:00
Kristian Høgsberg
dfaf65ba16 clients: Port simple-shm and simple-egl to xdg-shell 2014-02-07 17:01:57 -08:00
Jasper St. Pierre
9679cf9ba2 Update .gitignore 2014-02-07 14:53:31 -08:00
Jasper St. Pierre
7407345446 xdg-shell: Add set_margin request
This is used to figure out the size of "invisible" decorations, which we'll
use to better know the visible extents of the surface, which we can use for
constraining, titlebars, and more.
2014-02-06 13:05:03 -08:00
Jasper St. Pierre
2097fe12d4 xdg-shell: Add a "delete" event
This is equivalent to WM_DELETE_WINDOW request under X11, or equivalent
to pressing the "close" button under CSD. Weston currently doesn't have
a compositor-side way to close the window, so no new code is needed on
its side.
2014-02-06 13:05:03 -08:00
Kristian Høgsberg
e5b4dce642 build: Add missing AM_CFLAGS to client target CFLAGS 2014-02-05 22:00:59 -08:00
Kristian Høgsberg
44cd1968f2 xdg-shell: Drop edges arg from xdg_surface configure event 2014-02-05 21:37:58 -08:00
Jason Ekstrand
ab39f4db0f nested-client: Fix build error 2014-02-05 20:36:18 -08:00
Ander Conselvan de Oliveira
c94d6229dc compositor: Move view repositioning logic into shell
Remove the listener for output destroy from weston_view and instead
iterate views owned by the shell in its own output destroy listener.

This simplifies the code a bit since keeping the view listening for the
destroy on the right output was a bit complicated. This also removes the
function pointer output_destroyed from weston_view. The only user for it
was desktop shell, but now this is all handled in shell.c.
2014-02-05 17:36:00 -08:00
Ander Conselvan de Oliveira
a8a9baf873 compositor: Remove weston_output::move_signal
Since that signal is per output, it is necessary to track in which
output a view is in so that the signal is handled properly.

Instead, add a compositor wide output moved signal, that is handled by
the shell. The shell iterates over the layers it owns to move views
appropriately.
2014-02-05 17:32:35 -08:00
Emilio Pozuelo Monfort
7908bffdf9 dim-layer: fix dimming for unfocused surfaces
Unfocusing a surface should dim it when dim-layer is enabled,
but this got broken in commit 83ffd9.
2014-02-05 17:26:45 -08:00
Emilio Pozuelo Monfort
bf539e39c1 compositor-rpi: Fix input initialization
The input initialization code assumes the outputs have already
been initialized; thus create the outputs first. This fixes a
segfault upon startup. It is also what the drm and fbdev backends
do.
2014-02-05 17:23:46 -08:00
Bryce W. Harrington
c74ab15eac README: Fix typo; add link to testing docs
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-02-05 17:20:24 -08:00
Jason Ekstrand
8e96f9eb6a gl-renderer: Use eglSwapBuffersWithDamageEXT when available
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-02-05 17:16:37 -08:00
Jason Ekstrand
e5512d4014 gl-renderer: Track border damage and only repaint borders on an as-needed basis
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-02-05 17:16:28 -08:00
Kristian Høgsberg
9a7ad67d65 window: Delay scheduled redraws if we start maximize or fullscreen protocol
When we set the fullscreen flag, we have to wait for the corresponding
configure event and then attach a buffer of that size to indicate
that we've successfully gone fullscreen/maximized.

Without this patch, we can schedule a redraw and go through with it after
setting maximize/fullscreen and end up attaching a buffer of the wrong size.
In practice, what happens is that pressing the maximize button triggers
setting maximized, but also triggers a redraw to paint the maxmize button.
Without this change, repainting the button triggers a repaint that attaches
the same size buffer immediately.

https://bugs.freedesktop.org/show_bug.cgi?id=71927
2014-02-05 17:01:47 -08:00
Kristian Høgsberg
b405a80c05 terminal: Only reset title if we put the window size there
When resizing the terminal, it shows the grid size in the titlebar.
We reset the title next time we get an enter event.  This patch makes
sure we only reset the title the first time we enter after a resize.
2014-02-05 17:01:47 -08:00
Kristian Høgsberg
c896401209 input: Run touch binding before calling touch grab
We don't want to send events if the binding is going to handle the touch
event.  Also, this restricts touch bindings to only trigger on touch down.
For gesture bindings we want something similar to the motion signal we
have for the pointer.
2014-02-05 17:01:33 -08:00
Kristian Høgsberg
d2a0213ee4 window: Ask xkbcommon whether or not to repeat a key 2014-02-05 13:43:59 -08:00
Kristian Høgsberg
c988362a39 input: Transform to surface coordinates outside resource for loop
When we send the pointer motion event, the transform from compositor to
surface coordinates doesn't depend on the resource.  Transform the
coordinates up front instead of everytime we send to a resource.
2014-02-05 13:36:02 -08:00
Kristian Høgsberg
4c72f5721e shell: Remove elaborate if-statement with empty body 2014-02-05 13:36:01 -08:00
Kristian Høgsberg
0b7d9958a8 shell: Handle wl_shell surfaces created by xwayland correctly
When xwayland creates a shell surface we don't have a resource.  The
recently added shell_surface_is_wl_shell/xdg_surface() tests don't
handle that very well.

For now, we assume that a surface without a resource is created from
xwayland and is a wl_shell surface.  We'll want to modify that to be a
xdg surface eventually, but for now this stops weston from crashing.
2014-02-03 15:50:38 -08:00
Kristian Høgsberg
49fcd001b1 build: Pass pkg-config CFLAGS as target_CFLAGS, not CPPFLAGS 2014-02-03 11:21:41 -08:00
Kristian Høgsberg
1d2dd077e7 build: Add a rule for creating git-version.h when we don't have a git repo
For dist tarballs we ship git-version.h but if you do a git archive or
similar to check out a source tree, there's no git-version.h and no
way to make one.

https://bugs.freedesktop.org/show_bug.cgi?id=74459
2014-02-03 10:55:51 -08:00
Pekka Paalanen
5124b53a13 build: fix weston-info CFLAGS
CC       clients/weston-info.o
clients/weston-info.c:31:28: fatal error: wayland-client.h: No such file or directory
compilation terminated.
make[1]: *** [clients/weston-info.o] Error 1

Only triggerable if libwayland is only in a custom prefix.

Fix by adding CLIENT_CFLAGS.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-02-03 09:54:28 -08:00
Pekka Paalanen
cca3a06cab build: pass client flags to test programs
Fix build failures of the kind:

  CC       tests/bad-buffer-test.o
In file included from tests/weston-test-client-helper.h:28:0,
                 from tests/bad-buffer-test.c:28:
./protocol/wayland-test-client-protocol.h:35:28: fatal error: wayland-client.h: No such file or directory
compilation terminated.
make[1]: *** [tests/bad-buffer-test.o] Error 1

These are only triggerable if libwayland has not been installed
system-wide, but only in a custom prefix.

Since the Makefile already uses AM_CPPFLAGS, simply add
TEST_CLIENT_CFLAGS to test programs instead of dropping AM_CPPFLAGS.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-02-03 09:54:22 -08:00
Kristian Høgsberg
304d40d615 .gitignore: Add .dirstamp 2014-02-01 22:16:43 -08:00
Guillem Jover
dff63a2300 build: Set a default aux dir
This moves all the auxiliary build scripts into a build-aux directory,
and fixes an issue with configure being unable to find scripts because
it tries to change to an empty directory to get the absolute path,
which results in getting the path to the user's home directory instead.

,--
checking whether build environment is sane... yes
/bin/bash: /home/user/missing: No such file or directory
configure: WARNING: 'missing' script is too old or missing
`---

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2014-02-01 22:12:10 -08:00
Kristian Høgsberg
bece0ee726 build: Don't dist generated sources 2014-02-01 21:52:43 -08:00
Quentin Glidic
088ba5e475 Makefile.am: Fix protocol source files usage
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2014-02-01 21:21:39 -08:00
Kristian Høgsberg
5e647ca146 xwayland: Fix typo in open flags for Xorg log file 2014-02-01 20:44:54 -08:00
Kristian Høgsberg
6fd73cd3c0 build: Add -Wsign-compare to GCC flags 2014-02-01 11:02:41 -08:00
Jasper St. Pierre
1e47a93f85 Revert "stacking: Remove transient window support"
This reverts commit 4c1a11074af2c2221d50b0c35d2d0d883647bc15.

Use the new window_set_transient_for / window_get_transient_for
and xdg-shell support for this...
2014-02-01 01:53:05 -08:00
Jasper St. Pierre
53686048cc window: Add wrappers for xdg_surface_set_transient_for 2014-02-01 01:53:05 -08:00
Jasper St. Pierre
0790e3978a westoy: Port the toy toolkit over to xdg-shell 2014-02-01 01:53:05 -08:00
Jasper St. Pierre
c0f17aba5e westoy: Remove MAXIMIZED and FULLSCREEN as separate window types
xdg_shell changes this around so that they are flags on the remote
object itself, not separate surface types. Move to a system where
we calculate the state from the flags ourselves and set the appropriate
wl_shell_surface type.

When we port to xdg_shell, we'll drop these flags and simply sync
on the client.
2014-02-01 01:43:10 -08:00
Jasper St. Pierre
76ec0826bc westoy: Remove fullscreen methods
These aren't supported under xdg_shell, at least not right now.
If xdg_shell ever gets support for them, we can revert this commit
and adapt it.
2014-02-01 01:43:02 -08:00
Jasper St. Pierre
7f4386e90a westoy: Use subsurfaces for tooltips instead of transient windows
Transient windows, at least not as they are today, don't exist in
xdg_shell. Subsurfaces allow for specially placed surfaces relative
to a window, so use these instead.
2014-02-01 01:42:35 -08:00
Jasper St. Pierre
e22952bb13 westoy: Schedule a full resize when we add a subsurface
If a client adds a subsurface, we need to make sure it's allocated
properly, so queue a resize and redraw on the parent window.
2014-02-01 01:42:31 -08:00
Jasper St. Pierre
b0d604ff5b stacking: Remove transient window support
This will be replaced with xdg_surface_set_transient_for at some point...
2014-02-01 01:42:28 -08:00
Jasper St. Pierre
faf27a9a3b weston: Send xdg_surface_send_focused_[un]set when focusing surfaces 2014-02-01 01:41:01 -08:00
Ander Conselvan de Oliveira
f84327aef2 input: Remove exported function weston_pointer_verify()
Instead, add a compositor signal that an output has been destroyed and
handle that case locally in input.c.
2014-02-01 01:36:05 -08:00
Emilio Pozuelo Monfort
adaa20c017 desktop-shell: initialize children link
Since commit 9046d2, when destroying a surface, we remove all the
links from its children. But when the child surfaces are destroyed,
those links will be removed again, but since they were not properly
initialized, weston will crash.

Call shell_surface_set_parent instead which removes the link and
sets parent while also initializing the link, thus avoiding this
crash.
2014-02-01 01:29:13 -08:00
Emilio Pozuelo Monfort
38b58eba74 desktop-shell: maximize the surface with the kbd focus
We don't have focus-follows-mouse, so it makes more sense to
maximize or fullscreen the surface that has the keyboard focus,
not the one behind the pointer.
2014-02-01 01:26:34 -08:00
Guillem Jover
32b793cb7f compositor: Clarify XDG_RUNTIME_DIR misconfiguration message
If only the mode or the owner are wrong, do not say both are wrong.
Change the text to state that there's a problem and the current
values, and let the user figure it out.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2014-02-01 01:16:07 -08:00
Ander Conselvan de Oliveira
4d363cfcf6 input: Fix weston_seat_init_keyboard() error path
The pointer seat->keyboard was set before some possible error returns.
That pointer was left unchanged in case of failure, pointing to an
uninitialized keyboard struct (that was also leaked). If a client sent
a wl_seat::get_keyboard request, that would cause Weston to crash.

Fix this by setting the seat->keyboard pointer only after the keymap
initialization is done and there is no more possibilities for failure.
Also plug the memory leaks on the error path.

https://bugs.freedesktop.org/show_bug.cgi?id=74035
2014-02-01 01:14:22 -08:00
Ander Conselvan de Oliveira
23900f70e5 input: Empty the current input region when configuring pointer surfaces
The input region of the cursor surface is set to empty in
pointer_cursor_surface_configure(). Since during the commit process
this function is called before the pending input region is made
current, it empties surface->pending.input instead of surface->input.

But pointer_cursor_surface_configure() is also called from
pointer_set_cursor() in order to map the cursor even if there isn't a
subsequent attach and commit to the cursor surface. In that case,
surface->input is never emptied, since the configure function emptied
only the pending input region and there wasn't a commit that made it
effective.

Fix this by emptying both pending and current input regions. The latter
shouldn't cause problems since the surface can't have a role prior to
being assigned the cursor role, so it shouldn't be mapped in the first
place.

Also change toytoolkit so that it triggers the bug.

https://bugs.freedesktop.org/show_bug.cgi?id=73711
2014-02-01 01:12:24 -08:00
Kristian Høgsberg
cd31275f28 build: Stop using xmllint to validate protocol files
The scanner needs to be good enough.  If it crashes or fails to report
invalid input, that needs to get fixed.
2014-02-01 01:05:36 -08:00