Commit Graph

88 Commits

Author SHA1 Message Date
Giulio Camuffo c6ab3d52f5 compositor: let the shells create the screenshooter 2014-04-02 11:39:19 -07:00
Manuel Bachmann 805d2f536a shell: position input panel layer above fullscreen layer
When a client calls the input panel (weston-keyboard e.g.)
and then goes fullscreen, the panel will not be hidden
anymore.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
2014-04-02 10:35:26 -07:00
Manuel Bachmann c1ae2e817e compositor: use Mod-Tab to show/raise minimized surfaces
Temporarily show minimized surfaces when switching between
surfaces with the keyboard. If the final selected one was
minimized, it will be restored.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
2014-04-02 10:27:27 -07:00
Manuel Bachmann 50c87dbd95 compositor: implement xdg_surface_set_minimized()
We now handle the client-side xdg_surface_set_minimized()
call, and eventually hide the target surface by moving it
to a dedicated layer.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
2014-04-02 10:27:13 -07:00
Pekka Paalanen 952b6c8004 compositor: reorganize struct weston_buffer_viewport
Queueing in the Presentation extension requires splitting the viewport
state into buffer state and surface state. To conveniently allow
assigning only one, the other, or both, reorganize the
weston_buffer_viewport structure.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-04-01 16:46:40 -07:00
Jasper St. Pierre fe9671e30e shell: Correct error message when we already have an xdg surface
It was referencing get_shell_surface, which is absolutely wrong.
2014-03-25 10:59:20 -07:00
Kristian Høgsberg b033c5e1d0 shell: Only animate window closing for mapped windows
https://bugs.freedesktop.org/show_bug.cgi?id=76415
2014-03-20 14:49:07 -07:00
Kristian Høgsberg 160fe75b32 shell: Animate window closing
This provides an example of keeping a weston_surface alive after the client
destroys it.  We install a destroy listener for the resource, so that we'll
be notifified when the client destroys it.  Then we increase the weston_surface
refcount so that we keep the surface and initiate an animation.  When
the animation finishes we can finally destroy the surface.
2014-03-19 16:51:53 -07:00
Kristian Høgsberg c7680b09dd xdg-shell: Bump unstable version to 3 2014-02-19 10:14:46 -08:00
Kristian Høgsberg 283bf373a1 shell: Consolidate state changes into xdg_surface_change_state
This makes xdg_surface_change state the canonical place for changing
surface state and moves much of the duplicated code into one place.
2014-02-19 09:50:40 -08:00
Jasper St. Pierre 8c6aa45f97 xdg-shell: Replace the set_* atrocity with a new approach
Rather than require that the client implement two methods for every state,
simply have one global request, change_state, and one global event,
request_change_state.
2014-02-19 09:50:40 -08:00
Jasper St. Pierre b223a72147 xdg-shell: Rename focused_set / focused_unset to activated / deactivated
To try and make the distinction between this event and keyboard focus.
2014-02-18 16:39:01 -08:00
Jasper St. Pierre 63a9c336f3 Reorder the xdg_shell implementations to fit the spec'd order 2014-02-18 19:20:17 -05:00
Emilio Pozuelo Monfort a75920190e exposay: avoid needlessly activating the active view
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18 14:07:08 -08:00
Emilio Pozuelo Monfort f942b73a1c exposay: don't crash if a view goes away
When a view was destroyed while we were on exposay, we didn't
remove it from the list of views, and so when leaving exposay
we were trying to animate (and sometimes activate) a
non-existent view, causing a crash.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18 14:04:39 -08:00
Emilio Pozuelo Monfort 3b6e68e2c1 exposay: arrange views per-output
https://bugs.freedesktop.org/show_bug.cgi?id=73173
2014-02-18 14:04:24 -08:00
Kristian Høgsberg dd62abafa1 shell: Use the per-client responsiveness tracking for wl_shell as well 2014-02-12 21:29:11 -08:00
Kristian Høgsberg e11ef64534 compositor: Drop core ping_handler callout
This was always a little iffy.  At least it could have been a signal,
but we now have focus signal, so lets just use that.  We lose
the ability to detect unresponsive clients at key event time, but we
could add that back by adding a key_signal.
2014-02-11 16:35:22 -08:00
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
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
Kristian Høgsberg 44cd1968f2 xdg-shell: Drop edges arg from xdg_surface configure event 2014-02-05 21:37:58 -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
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
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
Jasper St. Pierre faf27a9a3b weston: Send xdg_surface_send_focused_[un]set when focusing surfaces 2014-02-01 01:41:01 -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
Kristian Høgsberg bc00dbe4f5 build: Move desktop-shell/Makefile.am into toplevel Makefile.am 2014-02-01 00:07:21 -08:00
Kristian Høgsberg d500bf1ac9 shell: Properly track the focus state surface
We have to move the surface destroy listener around as we track the
currently focused surface.  Introduce a helper function,
focus_state_set_focus() for this and use throughout.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73768
2014-01-22 12:25:20 -08:00
Ricardo Vieira f1c3bd8e81 shell: Don't move maximized window
We'll want to ask the client to unmaximize once we get support for that in
xdg-shell, but for now, just refuse moving a maximized window.
2014-01-20 10:36:28 -08:00
Kristian Høgsberg 0837fa9626 shell: Add mod+shift left-click as a resize binding
This lets us use compositor-initiated resize on laptops with touchpads and
no middle buttons.
2014-01-20 10:35:26 -08:00
U. Artie Eoff cf5737aa41 shell: assert get_shell_surface() != NULL as appropriate
Various functions that operate on a weston_surface assume the
surface has a shell_surface.  That is, they unconditionally
deref the get_shell_surface() result.  Hence, if for some reason
the call to get_shell_surface() returned NULL to those functions then
a segmentation fault would occur and the program would crash.  So,
adding an assert(...) on the get_shell_surface() return value adds an
extra sanity check and does not change this behavior.  The assert also
adds an extra benefit to the programmer by documenting that the function
expects and requires the weston_surface to have a shell_surface and
would be a program logic error, otherwise.

The assert() also silences some static analyzers about the possible
NULL deref.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:06:05 -08:00
U. Artie Eoff 0b23b2bd58 shell: validate create_focus_surface results
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:05:42 -08:00
U. Artie Eoff b571910584 shell: validate get_animation_type parameter
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:05:04 -08:00
U. Artie Eoff c4c7a4f921 input-panel: validate return value of get_default_view
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:04:56 -08:00
U. Artie Eoff 6d6d190b30 exposay: remove redundant NULL check in highlight_surface
exposay_highlight_surface() is called from exposay_pick(),
exposay_layout(), and exposay_maybe_move() where the esurface
parameter is already validated prior to the call.  This makes
the 'esurface' NULL check redundant.  This assumes any future
calls to exposay_highlight_surface() will also validate the
'esurface' parameter prior to the call.

This fixes the logic in exposay_highlight_surface so static
analyzers don't complain about the possibility that 'view'
might be NULL deref'd when a 'esurface' == NULL condition is
true.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:04:27 -08:00
Kristian Høgsberg 87d3b61355 shell: Don't start a fade animation if we don't have an output
When the last window of the X11 compositor is closed during a fade or
while locked, we'll try to start a fade back to the lock screen.  However,
if we closed the last window, there are no outputs left and the animation
will try to run with surface->output == NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=73665
2014-01-19 21:48:10 -08:00
Kristian Høgsberg 8fe412d35b Revert part of 17bccaed42
Commit 17bccaed42 accidentally reverted
the fix for 73490 from 5cbc763404.
2014-01-17 16:40:49 -08:00
Kristian Høgsberg 27d5fa8922 shell: Cancel popups when triggering screensaver
This is part of the fix for bug 72540.  We cancel the popup grab when the
screensaver kicks in so that the screen unlock dialog can get input events.
The bigger problem is in mesa however, where we try to allocate new buffers
as cairo-gles2 does a gratuituous (but valid) eglMakeCurrent() as we
remove the tooltip or popup-menu.

Since we removed the weston_layer with the regular surfaces, EGL blocks
waiting for a frame event that never comes.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72540
2014-01-17 16:22:50 -08:00
Kristian Høgsberg 8e80a31ba4 shell: Stop moving surfae after touch point 0 goes up
The grab stays alive as long as at least one touch point is down.  If touch
point 0 is lifted while other touch points are down, the surface will jump
around when touch point 0 is put down again.

This change marks the grab as inactive once touch point 0 is lifted
and then ignores touch events until all touch points eventually are
lifted and the grab terminates.

https://bugs.freedesktop.org/show_bug.cgi?id=73750
2014-01-17 15:18:35 -08:00
Kristian Høgsberg e61d2f4812 shell: Don't assign keyboard focus for seats without keyboard
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73570
2014-01-17 12:19:06 -08:00
Kristian Høgsberg 17bccaed42 input: Handle unplugging the output for a touchscreen device
A paired touch screen will stop sending events if its corresponding
output is unplugged.  An unpaired touchscreen will pick the new primary
output.

https://bugs.freedesktop.org/show_bug.cgi?id=73637
2014-01-16 17:08:26 -08:00
Kristian Høgsberg d56ab4eb18 shell: Disable exposay by default
Add a config file option to enable it, but leave it off by default.  Exposay
still triggers too many lock-ups or stuck grabs and triggers under X even
when the Wayland window doesn't have keyboard focus.
2014-01-16 16:52:12 -08:00
Kristian Høgsberg 5cbc763404 shell.c: Not all seats have pointers
Don't look up the pointer focus in ping_timeout_handler() if the
seat doesn't have a pointer.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73490
2014-01-15 11:46:38 -08:00
Kristian Høgsberg 211b517e8c shell: Move maximize and fullscreen bindings to mod + SHIFT
mod + f and mod + m conflict with too many application bindings, in
particular if mod is mapped to ALT.
2014-01-11 13:58:33 -08:00
Kristian Høgsberg 9046d2424a shell: Orphan child windows when a shell surface is destroyed
We now track the child surfaces of a shell surface and the child surfaces
have a pointer back to their parent.  We need to clean all this up and
NULL out the childrens parent pointers when a shell surface is destroyed.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72931
2014-01-10 00:25:30 -08:00