Commit Graph

328 Commits

Author SHA1 Message Date
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
Kristian Høgsberg f4d2f237f0 shell: Track pointer focus for all seats 2012-08-10 10:05:39 -04:00
Philipp Brüschweiler 711fda86cc shell: move input panels into a designated layer
This makes the separation between panels and input panels clearer and
prevents the (desktop) panel from removing existing input panels on
redraw.

The input panel layer is below the panel layer.
2012-08-09 17:13:14 -04:00
Ander Conselvan de Oliveira 383b671ccf shell: Fix repaint debugging
Since weston_surface_update_transform() was changed so it called
surface_damage_below() instead of surface_damage(), the trick of
clearing the surface damage did not work anymore.

Fix this by moving the repaint surface to a special plane before
calling update_transform. The move is made manually (as opposed to
calling weston_surface_move_to_plane()) to avoid the call to
weston_surface_damage_below(). The transform update causes the
damage to be added to this special plane, which is simply ignored.
After the geometry.dirty bit is clear, the surface is moved back to
the primary plane.
2012-08-09 14:37:01 -04:00
Philipp Brüschweiler 8801357332 shell: don't abuse link_layer for keeping track of input panel surfaces
Input panel surfaces were kept in a list by using layer_link of
weston_surface. This was pretty hacky and resulted in the bug that
an input panel surface was not removed from the list if it was unmapped
at the time of destruction.

This patch wraps the surface in a new input_panel_surface struct and
properly handles destruction with a signal listener.
2012-08-09 10:37:41 -04:00
Kristian Høgsberg 61f00f52fa shell: Make sure the black surface is opaque
So we don't repaint anything below it.
2012-08-03 16:37:01 -04:00
Kristian Høgsberg 79af73e313 compositor-drm: Disable planes when zoomed or capturing
When the entire output is transformed or we're capturing the output
for screenshot or video, disable all output specific overlays
(drm planes, hw cursors etc) and move all surfaces into the primary
plane.
2012-08-03 16:33:42 -04:00
Kristian Høgsberg bbe983923d shell: Make it possible to move and raise unresponsive surfaces 2012-08-01 00:20:21 -04:00
Kristian Høgsberg 9e31bff831 shell: Move surface move code back to just after the move grab functions
This chunk of code is what uses the move grab and used to come right
after it.  At some point it got split up, but move it back now.
2012-08-01 00:08:07 -04:00
Kristian Høgsberg 64eca8949b compositor: Fold the log prototypes into compositor.h and drop log.h
We're trying to keep the API exposed by the core compositor in compositor.h
2012-08-01 00:00:57 -04:00
Kristian Høgsberg e377822c64 shell: Give keyboard focus to top surface when current keyboard focus goes away 2012-07-31 22:18:02 -04:00
Kristian Høgsberg 2f5faff7f9 shell: Always track focus state per workspace
It's a little simpler than always creating and destroying it when we
switch workspace, and we'll need the focus_state soon.
2012-07-31 16:36:37 -04:00
Kristian Høgsberg c94de6450e shell: Remove unused shsurf->focus_state 2012-07-31 10:51:22 -04:00
Kristian Høgsberg b8e0d0f5ac shell: Use the right destroy listener in focus_state_surface_destroy()
We were dereferencing the seat destroy listener.
2012-07-31 10:30:26 -04:00
Tiago Vignatti 65191d144f shell: Remove unused pointer_end_grab
shell_grab_end already does that for us.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-07-20 15:31:52 -04:00
Kristian Høgsberg a08b528597 shell: Center fullscreen surface whenever new buffer is attached 2012-07-20 15:31:00 -04:00
Kristian Høgsberg 82a1d11cfa shell: Set shell_interface.shell at initialization 2012-07-19 14:02:49 -04:00
Kristian Høgsberg 94de680439 shell: Default to maximize/fullscreen on current output 2012-07-18 15:52:13 -04:00
Ander Conselvan de Oliveira eac9a46012 shell: Don't ping the grab surface
If the grab surface happens to be unresponsive, the busy cursor grab
will be started and that will cause the grab surface to receive focus,
which in turn leads to it being pingged again. Break the cycle by not
sending pings to it. If the shell is unresponsive it won't be able to
set the busy cursor anyway.
2012-07-16 13:35:25 -04:00
Kristian Høgsberg 240dfeb0fe shell: Scale fullscreen surface without cropping them, center on output 2012-07-12 12:32:31 -04:00
Juan Zhao 4ab9468865 shell: Use the correct the member name when iterating panel_list
It does not get the correct panel height for now.  The memeber of list
to read should be layer_link not link now.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-07-10 08:47:25 -04:00
Kristian Høgsberg e4d3a2bce6 Only position fullscreen surface in surface->configure callback
We end up calling shell_configure_fullscreen() from activate(), where
surface->buffer may be NULL.  Instead, call it on initial map and
first buffer attach after surface type change.  Both code path
come from the surface->configure callback where surface->buffer is know
to be non-NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=51678
2012-07-09 21:49:10 -04:00
Rob Bradford 31b6862eeb shell: Use desired output when sending configure events when maximised
With shell_surface.set_maximised the caller can provide an output to maximise
to or the default output will be used. With the corresponding configure we
should use the dimensions from the chosen output not the output the surface
was currently on.

Similarly when calculating the position for the window in the map() function
we should use the desired output again.

There is no need to assign shsurf->output to es->output since that happens in
the map() function later.
2012-07-02 15:16:19 -04:00
Ander Conselvan de Oliveira 00d17bb903 shell: Don't move fullscreen surfaces 2012-06-28 14:14:01 -04:00
Ander Conselvan de Oliveira b9d2a0fc0a shell: Show approprite cursors during move and resize grabs
This patch expands the busy cursor mechanism so that it is possible for
the desktop-shell client to show the appropriate cursor during grabs.
2012-06-28 14:13:57 -04:00
Kristian Høgsberg 73694c832b compositor: Move repaint debug binding to mod-shift-space
Alt-space or Super-space are too likely to conflict with application
bindings.
2012-06-28 14:13:10 -04:00
Kristian Høgsberg c7cd626bcf compositor: Update xkb state with key releases on focus out
This happens when vt-switching away from the compositor (drm) or
giving keyboard focus to a different X window.  Release the modifiers
so we don't get stuck modifiers.  We'll update with the new keys down
when we come back.
2012-06-28 13:46:09 -04:00
Kristian Høgsberg 8150b190d6 shell: Take a wl_surface as parent for transient and popup windows 2012-06-27 10:24:22 -04:00
Kristian Høgsberg 0636ac307e shell: Make input_panel just a regular wl_surface 2012-06-27 10:24:21 -04:00
Kristian Høgsberg 1a73a6335d shell: Make screensaver just a wl_surface 2012-06-27 10:24:21 -04:00
Kristian Høgsberg 730c94d62e shell: Make the lock surface just a plain wl_surface too 2012-06-27 10:24:21 -04:00
Kristian Høgsberg af7b1ffaf4 shell: Make panel just a wl_surface too 2012-06-27 10:24:21 -04:00
Kristian Høgsberg 962342cb8e shell: Don't make desktop_shell background a wl_shell_surface
We don't gain anything from taking a wl_shell_surface in
desktop_surface.set_background, except making wl_shell_surface
gratuitously dependent on wl_shell.  In shell.c we can also handle
backgrounds in their own background_configure function which simplifies
the mapping and placement logic.
2012-06-26 16:29:53 -04:00
Kristian Høgsberg ce345b0f60 shell: Fix inverted test for locked in workspace bindings 2012-06-25 21:35:42 -04:00
Kristian Høgsberg 4476aaff24 shell: Hide workspace layer when locking screen 2012-06-25 14:03:13 -04:00
Kristian Høgsberg 1ce6a2a2b3 shell: Animate input panel mapping
We slide it in from below.
2012-06-21 22:34:39 -04:00
Kristian Høgsberg 414bd420fd util: Generalize surface animation code
Too much duplicated code here, and we're about to introduce another
animation.
2012-06-21 22:07:30 -04:00
Kristian Høgsberg 85b2e4b6bf shell: Don't focus to background, screensaver or input_panel surfaces 2012-06-21 16:49:42 -04:00
Kristian Høgsberg a4a4de487e shell: Don't allow move/resize/rotate for input panel surfaces 2012-06-21 16:46:14 -04:00
Jan Arne Petersen 42feced8de shell: Add support for input panels 2012-06-21 16:41:06 -04:00
Kristian Høgsberg d813445f16 shell: Just use surface->private for shell_surface 2012-06-21 12:49:02 -04:00
Kristian Høgsberg 6c6fb993f7 shell: Schedule repaint when moving a surface
It seems we used to rely on the repaint scheduled by the cursor motion.
But if there's no cursor, there's no cursor motion, so we need to schedule
our own repaint.
2012-06-21 12:32:23 -04:00
Kristian Høgsberg b0d8e779df switcher: Don't use compositor->surface_list
compositor->surface_list is only valid during weston_output_repaint() so
don't use it in the switcher code.
2012-06-18 16:34:58 -04:00
Scott Moreau 8dacaaba1b Animate transitions for zoom focus point change.
Handle the transition when focus changes from text cursor to
mouse pointer or vice versa.
2012-06-18 11:07:03 -04:00
Kristian Høgsberg 7b5029f8d4 shell: Don't override the sprite surface output
This was a hack to force the sprite surface to have an output.  Not needed
not that the sprite surface is a regular client provided surface.
2012-06-15 16:31:27 -04:00
Jonas Ådahl 04769744e1 shell: Store focus state in workspaces
When moving moving back to a workspace or resuming a locked desktop the
keyboard focus state information was lost. By pushing the state to the
workspace when navigating away from a workspace, or locking a desktop,
we can restore it when navigating back, or resuming.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:20:38 -04:00
Jonas Ådahl 62fcd0417e shell: Animate workspace changes
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:20:30 -04:00
Jonas Ådahl e3cddce5a6 shell: Virtual workspaces
A workspace is a list of top level surfaces visible at a time. New
toplevel surfaces are added to the current workspace. Default
keybindings (modifier - Up, modifier - Down, modifier - F1 up to F6) are
used for navigating between workspaces. By default a single workspace is
created.

Surfaces of inactive workspaces have their outputs NULL:ed so that frame
callbacks gets queued instead of emitted. When workspace gets visible
again surface's outputs are assigned.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:20:22 -04:00
Scott Moreau e6603981da Implement animated transitions for zoom in/out. 2012-06-11 23:45:25 -04:00
Martin Minarik 6d11836721 Replace fprintf() by weston_log() 2012-06-08 13:11:36 -04:00
Kristian Høgsberg b2af93ef8c compositor: Drop weston_surface_to_global()
Just always call weston_surface_to_global_float() instead.
2012-06-07 20:10:23 -04:00
Kristian Høgsberg 633b14505c shell: Emit destroy signal for when we manually destroy shell surface 2012-06-07 18:08:47 -04:00
Kristian Høgsberg 47b5dca409 shell: Don't remove grab listener if surface was destroyed 2012-06-07 18:08:04 -04:00
Pekka Paalanen 43e1ba8073 shell: fix crash when no pointer device
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-07 16:43:56 -04:00
Pekka Paalanen 4e1f2ff1c6 shell: fix a crash during 'make check'
$ abs_builddir=$PWD/tests gdb -args ./src/weston --module=$PWD/tests/.libs/event-test.so

(gdb) run
Starting program: /home/pq/git/wayland-demos/src/weston --module=/home/pq/git/wayland-demos/tests/.libs/event-test.so
[Thread debugging using libthread_db enabled]
Mesa: Initializing x86-64 optimizations
launching /home/pq/git/wayland-demos/tests/test-client
created output global 0x608f50
test-client: got create-surface
got surface 5 from client
got surface id 5

Program received signal SIGSEGV, Segmentation fault.
Mesa: Initializing x86-64 optimizations
0x00007fffeff72c7c in handle_pointer_focus (listener=0x74f5c0, data=0x6faa40) at shell.c:492
492		if (shsurf->unresponsive) {
(gdb) bt
 #0  0x00007fffeff72c7c in handle_pointer_focus (listener=0x74f5c0, data=0x6faa40) at shell.c:492
 #1  0x00007ffff5ed8b87 in wl_signal_emit (data=0x6faa40, signal=0x6faa88) at wayland-server.h:166
 #2  wl_pointer_set_focus (pointer=0x6faa40, surface=<optimized out>, sx=12800, sy=12800) at wayland-server.c:752
 #3  0x0000000000407d92 in weston_device_repick (seat=0x6fa930) at compositor.c:633
 #4  0x0000000000407e49 in weston_compositor_repick (compositor=0x61c510) at compositor.c:656
 #5  0x00000000004092e1 in weston_output_repaint (output=0x7b85b0, msecs=-1046834186) at compositor.c:1059
 #6  0x00000000004094b4 in weston_output_finish_frame (output=0x7b85b0, msecs=-1046834186) at compositor.c:1092
 #7  0x00007ffff211e3c1 in finish_frame_handler (data=0x7b85b0) at compositor-x11.c:284
 #8  0x00007ffff5eda603 in wl_event_source_timer_dispatch (source=0x79ee50, ep=<optimized out>) at event-loop.c:173
 #9  0x00007ffff5edaca0 in wl_event_loop_dispatch (loop=0x61b940, timeout=<optimized out>) at event-loop.c:410
 #10 0x00007ffff5ed8dbd in wl_display_run (display=0x61b8f0) at wayland-server.c:1025
 #11 0x000000000040ecb1 in main (argc=1, argv=0x7fffffffdd98) at compositor.c:3225
(gdb) print shsurf
$1 = (struct shell_surface *) 0x0

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:27:56 -04:00
Kristian Høgsberg d56bd908bf shell: Use a busy cursor animation for unresponsive surfaces 2012-06-05 09:58:51 -04:00
Daniel Stone 0c1e46eb18 Use wl_fixed_t for axis bindings
In preparation for axis values being wl_fixed_t in the protocol as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:20 -04:00
Daniel Stone 325fc2d53a Split bindings into separate key/button/axis bindings
Rather than attempting to have the one handler prototype everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:16 -04:00
Daniel Stone b21046836f shell: Reset focus for all seats on activation
Rather than using a single hardcoded seat to activate new windows within
a compositor, reset the focus for all seats.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:02 -04:00
Daniel Stone c9785eacca Use enum wl_keyboard_key_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_keyboard_key_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:43:03 -04:00
Daniel Stone 4dbadb1556 Use enum wl_pointer_button_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:47 -04:00
Daniel Stone 496ca17a77 Convert Weston modifier #defines to an enum
To avoid any possible collision between the disparate XKB and Weston
modifier namespaces.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:28:23 -04:00
Daniel Stone 351eb61fbc Support wl_keyboard::modifiers event
This event lets the compositor inform clients of the canonical keyboard
modifier/group state.  Make sure we send it at appropriate moments from
the compositor, and listen for it in clients as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:27:47 -04:00
Scott Moreau 7a1b32a198 Implement text cursor position protocol.
Here we create a new client/compositor interface in weston to allow
clients to report their x/y cursor position to the compositor. These
values are then used to center the zoom area on this point. This
is useful for everyone, especially people who are visually impaired.
2012-05-31 13:10:22 -04:00
Kristian Høgsberg 92a57db6f2 shell: Add keybinding to force-close (SIGKILL) inactive clients 2012-05-26 13:41:06 -04:00
Tiago Vignatti 99aeb1e72d shell: use transient flags for activate or not new surfaces
Inactive surfaces doesn't set keyboard focus, so it can be used for tooltips,
toolbars and some other type of windows.

This requires protocol side changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-25 22:52:03 -04:00
Kristian Høgsberg c1693f209a xwm: Implement resizing by frame borders 2012-05-22 16:56:23 -04:00
Kristian Høgsberg a61ca06b49 xwm: Add window resize support 2012-05-22 16:05:52 -04:00
Kristian Høgsberg 9b68af0608 shell: Add back mod+pageup/down keybindings for zoom
This way we can use zoom without a scrollwheel/touchpad.
2012-05-22 12:58:47 -04:00
Scott Moreau 850ca42b9b Restructure output zoom.
A quick clean-up of zoom to prepare for the other patches in this series.
2012-05-22 12:58:47 -04:00
Scott Moreau 02709afb51 shell: Update relevant bits to work with recent alpha value changes. 2012-05-22 11:33:36 -04:00
Kristian Høgsberg 9540ea61a0 shell: Fix broken indentation in shell_get_shell_surface() 2012-05-21 17:03:16 -04:00
Kristian Høgsberg 45ba869ff3 shell: Make create_shell_surface() just return the shsurf 2012-05-21 17:03:16 -04:00
Kristian Høgsberg a416fa15d5 xwm: Switch alpha, brightness and saturation to GLfloat 2012-05-21 17:03:06 -04:00
Rob Bradford 579f2934de shell: Remove fading animation from animation list when surface destroyed
Fixes crash with a backtrace like this:

==2418== Invalid read of size 8
==2418==    at 0x8AC5B70: unresponsive_fade_frame (shell.c:374)
==2418==    by 0x409FE0: weston_output_finish_frame (compositor.c:1060)
==2418==    by 0x567043B: wl_event_loop_dispatch (event-loop.c:389)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)
==2418==  Address 0x8aba650 is 80 bytes inside a block of size 656 free'd
==2418==    at 0x4A0662E: free (vg_replace_malloc.c:366)
==2418==    by 0x566D93B: wl_resource_destroy (wayland-server.c:408)
==2418==    by 0x566D30E: destroy_resource (wayland-server.h:166)
==2418==    by 0x566D93B: wl_resource_destroy (wayland-server.c:408)
==2418==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==2418==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==2418==    by 0x5671AAE: wl_closure_invoke (connection.c:770)
==2418==    by 0x566DBAA: wl_client_connection_data (wayland-server.c:255)
==2418==    by 0x5670497: wl_event_loop_dispatch (event-loop.c:410)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)a

and

==2418== Invalid read of size 8
==2418==    at 0x34F1E180E1: pixman_region32_union (pixman-region.c:1405)
==2418==    by 0x407F66: weston_surface_damage (compositor.c:551)
==2418==    by 0x409FE0: weston_output_finish_frame (compositor.c:1060)
==2418==    by 0x567043B: wl_event_loop_dispatch (event-loop.c:389)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)
==2418==  Address 0x851dfe8 is 136 bytes inside a block of size 680 free'd
==2418==    at 0x4A0662E: free (vg_replace_malloc.c:366)
==2418==    by 0x566D93B: wl_resource_destroy (wayland-server.c:408)
==2418==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==2418==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==2418==    by 0x5671AAE: wl_closure_invoke (connection.c:770)
==2418==    by 0x566DBAA: wl_client_connection_data (wayland-server.c:255)
==2418==    by 0x5670497: wl_event_loop_dispatch (event-loop.c:410)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)
2012-05-21 13:59:00 -04:00
Tiago Vignatti 491bac19c7 shell: Expose set_transient in shell interface 2012-05-18 16:37:43 -04:00
Kristian Høgsberg 938b8fa3c2 shell: Expose surface move functionality in shell interface 2012-05-18 13:47:15 -04:00
Daniel Stone 37816df646 Convert wl_input_device to wl_seat (and friends)
wl_input_device has been both renamed and split.  wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.

It now only generates one event: to let clients know that it has new
capabilities.  It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.

This commit tracks these changes in weston and the clients, as well as
similar renames (e.g. weston_input_device -> weston_seat).  Some other
changes were necessary, e.g. renaming the name for the visible mouse
sprite from 'pointer' to 'cursor' so as to not conflict.

For simplicity, every seat is always exposed with all three interfaces,
although this will change as time goes on.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-16 15:29:06 -04:00
Scott Moreau dc549932b7 Convert wl_fixed_t to int in weston_output_update_zoom().
This way, we don't have to use wl_fixed_to_int() for each
call to weston_output_update_zoom(). It accepts wl_fixed_t
types and converts internally.
2012-05-16 11:04:04 -04:00
Kristian Høgsberg 88c1607fb7 shell: Remove lock/unlock listeners on shutdown 2012-05-16 08:04:19 -04:00
Kristian Høgsberg b71302e1db Fix a few -pedantic warnings
We're not enabling -pedantic by default, but a quick test brought up a few
issues that we should fix.
2012-05-10 14:11:44 -04:00
Daniel Stone 103db7fb56 Convert wire input co-ordinates to fixed-point
To add greater precision when working with transformed surfaces and/or
high-resolution input devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:41:01 -04:00
Tiago Vignatti 52e598cf51 shell: use own struct for transient surfaces
No functional changes; it's only opening space for modifications coming along
on the next commits.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-07 16:54:53 -04:00
Tiago Vignatti 70e5c9cc42 shell: fix uninitialized variable warning
and shut-up valgrind:
 Conditional jump or move depends on uninitialised value(s)
    at 0xB5AFB05: shell_surface_configure (shell.c:2162)
    by 0x407B0C: surface_attach (compositor.c:1225)
    by 0x621FA13: ffi_call_unix64
    by 0x621F434: ffi_call
    by 0x4E3D3F5: wl_closure_invoke (connection.c:758)
    by 0x4E3786C: wl_client_connection_data (wayland-server.c:255)
    by 0x4E3AA19: wl_event_source_fd_dispatch (event-loop.c:78)
    by 0x4E3B533: wl_event_loop_dispatch (event-loop.c:460)
    by 0x4E38D2C: wl_display_run (wayland-server.c:907)
    by 0x40B5DD: main (compositor.c:2748)

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-07 16:54:32 -04:00
Daniel Stone e5a0120757 Rename 'state' in axis (or ambiguous) bindings to 'value'
Since it's usually an axis value rather than a boolean, be slightly more
explicit about it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 13:03:48 -04:00
Daniel Stone da5b93c8d7 Change key/button grab bindings to take unsigned state
'state' here meaning 'is it up or down?', obviously.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 12:54:14 -04:00
Kristian Høgsberg e7afd919c9 shell: Handle set_title and set_class 2012-05-02 09:47:44 -04:00
Kristian Høgsberg f7e23d5c88 shell: Always configure when surface type changes
We can drop the force_configure hack.
2012-04-27 17:51:59 -04:00
Kristian Høgsberg 7f366e7053 shell: Don't move or reconfigure surfaces until we get the new buffer
Going from fullscreen to toplevel will restore the surface position
immediately.  This will move the fullscreen surface to where the toplevel
surface was before, which will flicker for a frame of two before the
resized, non-fullscreen buffer is attached.

Instead, only change the surface geometry when we get the new buffer.
2012-04-27 17:49:40 -04:00
Alex Wu 7bcb8bd30e shell: Fix not remove rotation for fullscreen surf
Remove rotation when entering fullscreen and restore rotation when exiting.

https://bugs.freedesktop.org/show_bug.cgi?id=48906
2012-04-27 15:10:37 -04:00
Ander Conselvan de Oliveira fb9808993b shell: allocate enough memory for shsurf->ping_timer 2012-04-27 15:06:18 -04:00
Juan Zhao e10d279017 shell-animation: add conf option in shell
Now we can choose zoom or fade in weston.ini
to fulfill and customize the user experence easier.

Signed-off-by: Juan Zhao <juan.j.zhao@intel.com>
2012-04-25 10:38:19 -04:00
Kristian Høgsberg ca535c1998 shell: Don't ping internal shell surfaces
This is a hack for now to get xserver surfaces working again.
2012-04-21 23:21:33 -04:00
Tiago Vignatti bc052c99f9 compositor: introduce internal shell_interface
We're able now to create shell_surfaces inside Weston. This makes possible the
glue needed between shell and xserver-launcher.

On the desktop-shell, it was split the protocol part from shell_surface
specific functions to make this possible.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-04-21 23:21:08 -04:00
Kristian Høgsberg a4e8b33704 shell: Move binding-modifier to shell section 2012-04-20 16:48:21 -04:00
Tiago Vignatti 0b52d4810d shell: modifier bindings configurable
This patch makes the main modifier configurable.  We used to hardcode super
(windows key) for most bindings, but now that can be changed.

The change affects two key bindings: rotation moves to mod+right click
and backlight moves to from ctrl+f9/f10 to mod+f9/f10.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-04-20 16:38:35 -04:00
Scott Moreau 9521d5e553 shell: Cleanup ping_timer code.
- Added ping_timer_destroy() to simplify cleanup.
 - Changed timeout and fade step to more realistic values.
 - Renamed ping_timeout_fade_frame() to unresponsive_fade_frame().
2012-04-19 15:12:43 -04:00
Scott Moreau c3e54eb8f0 Dim unresponsive windows
If a client is not responding, lower the brightness and
saturation to indicate it's stalled. The surface is restored
to it's original color values if the client later becomes
responsive.
2012-04-19 12:51:01 -04:00
Scott Moreau ff1db4a4f3 Install structuring for ping-pong protocol 2012-04-19 12:50:47 -04:00
Alex Wu bd3354b8b2 shell: Implement "driver" method of fullsceen.
Switching display mode may happen when:
1. The fullscreen surface is at top most in fullscreen layer and with
   "driver" method. Shell will switch output mode to match the surface
   size. If no matched mode found, fall back to "fill" method.
2. The top fullscreen surface is destroyed or unset. Switch back to the
   origin mode.
2012-04-17 14:38:45 -04:00
Tiago Vignatti be14326efd desktop-shell: use more consistent name for the main structure
wl_shell is more likely to be used for core protocol specific. Now it follows
pretty much the same style of what tablet-shell is using.

No functional changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-04-16 11:55:24 -04:00
Kristian Høgsberg 3730f36c6e shell: Tighten shell.set_popup semantics
We need to use the input device from the request, and check that the
serial matches the serial from the latest button press.
2012-04-13 12:40:18 -04:00
Kristian Høgsberg 02e79dc935 compositor: Add a destroy signal and turn weston_shell into signals 2012-04-12 16:16:38 -04:00
Kristian Høgsberg 27e30526db Use wl_signal mechanism
Mostly mechanical rewrite to track waylands change to struct wl_signal.
2012-04-12 16:15:56 -04:00
Kristian Høgsberg eae5de7609 Follow wayland change to serial numbers 2012-04-11 22:42:15 -04:00