Commit graph

232 commits

Author SHA1 Message Date
Ander Conselvan de Oliveira ee41605446 animation: Make fade more controllable
Add parameters to weston_fade_run() for setting the initial and target
values for the fade, as well as a parameter to set the spring constant
used for the animation.

Also add the weston_fade_update() function, that allows the animation
to be changed while it is still running.

This will be used to move the fade animation from core Weston into the
shell. These changes are needed to be able to fade out as well as in,
and to be able to reverse the fade in case of user input.
2013-02-21 21:12:44 -05:00
Kristian Høgsberg cb4685bbd1 Pass argc and argv to modules
This lets modules parse options from the command line.
2013-02-20 15:37:49 -05:00
Giulio Camuffo 8aa16174e2 shell: Do not hang when mapping a popup twice
When calling shell_map_popup() more than one time on the same shell_surface
the parent transform was getting added more than one time to the transform
list, resulting in an infinite loop when going through the list with
wl_list_for_each in weston_surface_update_transform_enable().
This commit removes the old transform before adding it again.
2013-02-18 16:56:40 -05:00
Jan Arne Petersen 6138197337 text: Add show/hide_input_panel requests
Allows to show/hide the input panel (virtual keyboard) more independent
of focus (some applications might to require additionaly click on a
focused entry to show the input panel).

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:35 -05:00
Jan Arne Petersen ffbb20f730 text: Move input_panel interface to input-method
Move the input_panel interface from desktop-shell to input-method (since
it is not really tied to desktop-shell).

Add an input_panel_surface interface like wl_shell_surface to make it
easier to extend it. Also add a parameter to the set_toplevel request to
be able to specify where to show an input panel surface on the screen.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:05:04 -05:00
Jan Arne Petersen 23ccfb3ef9 shell: Do not hang after setting input_panel twice
Ignore multiple calls with the same surface in input_panel_set_surface.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:03:18 -05:00
Jan Arne Petersen af7b6c9c6d shell: Do not crash when hiding input_panel
Allow an input panel to attach a NULL-buffer for hiding.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:03:08 -05:00
Jan Arne Petersen a75a789fc1 text: fix weston key bindings with input methods
Add a struct weston_keyboard, to handle the input method grab.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:26 -05:00
Ander Conselvan de Oliveira 18639f8d4a shell: Set the DPMS state if the screensaver fails to launch or dies
The lock hook in desktop-shell only changes the DPMS state the second
time it is called, because during the first time it launches the
screensaver and wakes the compositor again when the screensaver surface
is configured. However, if the screensaver fails to launch, the output
is left in an enabled state, even thought there's no content being
displayed on the screen.

Fix this by disabling the outputs when the screensaver dies if the
shell is still locked.

https://bugs.freedesktop.org/show_bug.cgi?id=60084
2013-02-15 14:06:15 -05:00
Jan Arne Petersen 451a97136f shell: Fix bug when input panel is shown twice
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-14 21:56:48 -05:00
Kristian Høgsberg 0c36903fb3 shell: Add back ability to rotate unresponsive surfaces
When a surface in deemed unresponsive and we trigger the busy cursor, it's
no longer possible to rotate the surface.  This is clearly unacceptable.
This patch adds handling of right clicks to the busy grab so that we can
continue to rotate a surface even if the client is sleeping.

https://bugs.freedesktop.org/show_bug.cgi?id=60609
2013-02-14 21:33:42 -05:00
Rob Bradford 9f3dd15183 shell: Bypass fullscreen scaling if surface width and height match output
If our surface has width and height set to the same dimensions as the output
then we can bypassing the scale factor calculation and addition of the
transformation.

The use case that led to this optimisation is the playback of video using
gstreamer-vaapi with the "scale" method. The video is the same dimensions as
the output (1080p.)
2013-02-14 13:40:52 -05:00
Kristian Høgsberg b810eb5750 xwm: Support _NET_WM_STATE_FULLSCREEN
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.
2013-02-12 21:55:51 -05:00
Quentin Glidic c0d79ce2ba shell: Whitespaces cleanup
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-01-29 09:26:43 -05:00
Vasily Khoruzhick 1bbf372e31 matrix: track transform type
Introduce several matrix transform types and track type for matrix.
Could be usefull for activating some fastpath that depends on some
transform type.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2013-01-28 16:10:03 -05:00
Pekka Paalanen 3a1d07d5e7 shell: remove remnants of screensaver surface list
The list became stale probably when the lock_layer was introduced. Now
one less (ab)user of weston_surface::link.

Also add a comment on screensaver_configure(), that it is (and has been)
broken for pre-started screensavers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-01-24 16:18:32 -05:00
Jonas Ådahl a178f70965 shell: Don't lower fullscreen layer on activate
To be able to have a fullscreen surface on one output, and interact with
surfaces on another output, don't lower the fullscreen layer on
activate.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-01-15 15:57:45 -05:00
Jonas Ådahl 33619a4955 shell: Set input region of the black fullscreen surface
The input region of the black surface placed under the fullscreen shell
surface did not have a specified input region. Because the initial input
region of a surface is infinity, no other surface on any other output
could get any focus.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-01-15 15:35:34 -05:00
Rob Bradford db9993875e shell: Remove confusing case fall-through
This avoids calling weston_surface_set_position twice on the same surface. The
second call has no effect in many cases because sx and sy
are usually zero on this path.

This change now means that any sx/sy values passed into ::attach will be
ignored on the first attach for popup surfaces. This similar to the behaviour
for other surface types.
2012-12-06 22:34:20 -05:00
Pekka Paalanen de685b8843 compositor: introduce weston_buffer_reference
The wl_buffer reference counting API has been inconsistent. You would
manually increment the refcount and register a destroy listener, as
opposed to calling weston_buffer_post_release(), which internally
decremented the refcount, and then removing a list item.

Replace both cases with a single function:
weston_buffer_reference(weston_buffer_reference *ref, wl_buffer *buffer)

Buffer is assigned to ref->buffer, while taking care of all the refcounting
and release posting. You take a reference by passing a non-NULL buffer, and
release a reference by passing NULL as buffer. The function uses an
internal wl_buffer destroy listener, so the pointer gets reset on
destruction automatically.

This is inspired by the pipe_resource_reference() of Mesa, and modified
by krh's suggestion to add struct weston_buffer_reference.

Additionally, when a surface gets destroyed, the associated wl_buffer
will send a release event. Often the buffer is already destroyed on
client side, so the event will be discarded by libwayland-client.

Compositor-drm.c is converted to use weston_buffer_reference.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-12-06 16:07:43 -05:00
Jan Arne Petersen 82ec909b07 shell: Do not remove input panel layer when locked
Do not remove the input panel layer from the layer list when the
shell is locked in hide_input_panels().

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

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-12-06 15:55:14 -05:00
Ander Conselvan de Oliveira 012b4c78c9 compositor: Implement buffer transformation
Implement the wl_surface.set_buffer_transform request. This includes
tracking the double-buffered buffer transformation parameter and making
the gl renderer able to handle transformed buffers.
2012-11-27 11:29:31 -05:00
Ville Syrjälä aa628d0a7c shell/zoom: Increment/decrement disable_planes only when zoom.active changes
disable_planes should only be incremented when zoom.active actually
toggles. Otherwise the counter will be incremented too many times,
and planes will no longer get used.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-11-16 18:39:30 -05:00
Ander Conselvan de Oliveira f97f811cf3 shell: Remove the old repaint debug mode
This was obsoleted by fan repaint debug.
2012-11-08 16:56:25 -05:00
Ander Conselvan de Oliveira c509d2b152 compositor: Add debug key bindings infrastructure
Add the concept of debug key bindings, that are bindings that activate
debug features in the compositor. The bindings are added to a list in
the compositor, but the triggering them is left to the shell.

On the shell side, a global debug key binding is added. When the user
presses mod-shift-space, the shell will invoke the debug bindings based
on the next key press.

This also converts the debug shortcuts for repaint debugging, fan
repaint debugging and the hide overlays shortcut in compositor-drm to
use the new infrastructure.
2012-11-08 16:56:25 -05:00
Jan Arne Petersen cf18a32a39 shell: Do not insert input panel layer when locked
Do not try to insert the input panel layer in the layer list when the
shell is locked in show_input_panels(). The layer will already be
insrted in resume_desktop() anyways.

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

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 11:45:09 -05:00
Kristian Høgsberg 57e090746e shell: End popups if we trigger a shell grab
Clicking outside popups closes them except in case of a shell grab
(move, resize or rotate), in which case we move the parent window away
from under the popup.  Instead, just end the popup in those cases.

https://bugs.freedesktop.org/show_bug.cgi?id=55674
2012-10-30 14:09:36 -04:00
Jonas Ådahl b0b87baf7c shell: Update bindings to conform to pointer axis protocol
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-15 20:54:43 -04:00
Pekka Paalanen b89b004e57 shell: do not double-init input region
weston_surface_create() already inits the input region.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:52 -04:00
Pekka Paalanen 71f6f3b04c shell: do not double-init a region
weston_surface_create() already inits the opaque region, so the second
init in create_black_surface() is logically wrong. Whether this was a
memory leak or not, depends on Pixman internals.

Fini before initing again.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:35 -04:00
Rafal Mielniczuk 3e3862c3bc shell: restore correct layer in shell_unset_fullscreen
This fixes the bug where surface is above panel_layer
just after it is restored from fullscreen mode.

How to reproduce:
* move surface under panel
* set surface fullscreen
* restore surface to normal mode
2012-10-09 23:10:28 -04:00
John Kåre Alsaker 490d02a96d weston: Use float instead of GLfloat. 2012-10-04 12:27:21 -04:00
Tiago Vignatti 1d01b01318 compositor: Add kill signal
For now it's being emitted only on the desktop shell kill binding.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-04 11:06:37 -04:00
Tiago Vignatti 920f1970a4 shell: Skip clients that we forked ourselves in kill binding
When we fork a client and give one end of a socketpair, the credentials
on the socket fd comes back as ourselves.  When that happens, do not kill
the process.

Also remove superfluous variables.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-04 11:03:49 -04:00
Tiago Vignatti b7dbbd6fc7 shell: Start the desktop-shell client in the idle handler
https://bugs.freedesktop.org/show_bug.cgi?id=55259

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-04 11:00:05 -04:00
Jan Arne Petersen 1428b8ccf7 shell: Fix crash when an input panel is hiding
Set the geometry.dirty on the input panel surface before calling
weston_surface_update_transform, so that the surface gets an output
assigned.
2012-09-26 11:28:31 -04:00
Ander Conselvan de Oliveira 231ba171c6 compositor: Always assign an output when updating a surface transform
Also make all the callers of weston_surface_assign_output() update the
transform instead. This makes sure that when the surface is assigned an
output its bouding box is valid.

This fixes a bug where a newly created surface would have a NULL output
assigned. This would cause weston_surface_schedule_repaint() to not
schedule a repaint, preventing the surface to be shown until something
else caused a repaint.
2012-09-14 13:43:08 -04:00
Kristian Høgsberg b00a9d3cb9 compositor: Make all non-backend modules use module_init() as entry point 2012-09-11 14:06:27 -04:00
Philipp Brüschweiler 067abf67cd workspaces: don't segfault on invalid move_surface_to_workspace request
Also fixes the off-by-one in toytoolkit that exposed the issue.
2012-09-04 15:56:24 -04:00
Jonas Ådahl 8538b22ff4 shell: Improve focus handling when moving surfaces between workspaces
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-08-31 19:51:55 -04:00
Jonas Ådahl e9d2250549 shell: Introduce workspace manager interface
The workspace manager interface purpose is to provide clients with
control and knowledge about the current workspace state. Initially only
one function and one event exists; moving a surface and state updated
event. A workspace is represented as an index in a 1 dimensional array.

A client keeps track of the state by being broadcasted events when the
state changes, currently limited to current workspace or number of
workspaces available.

A client can send an asynchronous request to the manager asking to move
a surface to workspace identified by an index. It is up to the shell to
actually move it.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-08-31 19:51:49 -04:00
Jonas Ådahl 8de6a1ddae shell: Add possibility to move surfaces to other workspaces
By default, Control + Shift + Up/Down will move the currently active
surface, if any, while changing to another workspace.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-08-31 19:51:14 -04:00
Jonas Ådahl 568994400b shell: Always set focus when restoring focus state
To avoid having a surface on a hidden workspace in focus always set the
focus (even to NULL) when restoring.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-08-31 19:51:04 -04:00
Pekka Paalanen 07c91f8371 compositor: triangle fan debug
Draw the borders of all the triangles.

v1: original
v2: add keybinding to enable/disable fan debug (super-alt-space),
    cycle colors to make it easier to see individual draws, and
    redraw undamaged region to clean up previous frames debug
    lines

Signed-off-by: Rob Clark <rob@ti.com>
2012-08-31 17:52:01 -04:00
Scott Moreau 1bad5db9d6 Implement output transformations.
This patch allows rotation and mirroring outputs for x11 and drm backends.
A new 'transform' key can be set in the [output] section. From the protocol:

"The flipped values correspond to an initial flip around a vertical axis
followed by rotation."

The transform key can be one of the following 8 strings:

normal
90
180
270
flipped
flipped-90
flipped-180
flipped-270
2012-08-29 14:39:13 -04:00
Philipp Brüschweiler 6cef009272 shell: don't segfault when pressing super+k when no surface is focused 2012-08-13 16:30:55 -04:00
Scott Moreau 4272e63991 shell: Eliminate unneeded function.
Replace all occurrences of workspace_damage_all_surfaces() with
weston_compositor_schedule_repaint(). This fixes a bug exposed by
982387011f where trying to switch workspaces while there are no
surfaces on the current workspace fails to start the animation.
2012-08-13 12:57:56 -04:00
Rob Bradford 4cb88c79e0 shell: Avoid modulo by zero error in positioning algorithm
As spotted by Philipp Brüschweiler <blei42@gmail.com>
2012-08-13 11:12:17 -04:00
Rob Bradford ac63e5bd7e shell: Enhance the basic random positioning algorithm
Place the window in a random position on the output where the first seat with
a pointer is. When calculating the random position limit the range to the
area that would ensure that the whole surface is visible. If the surface is
larger than the output then the surface is placed at the origin of the
output.

This change is based on the good work of Scott Moreau <oreaus@gmail.com>
2012-08-13 10:01:46 -04:00
Kristian Høgsberg 92374e1409 shell: Ignore unsolicited pong requests
If a client sends a pong message out of the blue, we deref ping_timer
which is NULL and then crash.  Unsolicited pong requests indicate that
something is wrong on the client, but the compositor should survide that.
2012-08-13 10:01:46 -04:00