Commit Graph

2426 Commits

Author SHA1 Message Date
Philipp Brüschweiler
1f54f17ef8 image: handle multiple images correctly
Don't stop the application when only one window is closed. Don't stall
indefinitely if no valid image file is given as input.
2012-08-13 16:30:55 -04:00
Philipp Brüschweiler
f22d0ecd97 dnd: fix segfault on grabbing
Some cursor themes don't include a "grabbing" icon, causing a segfault.
This patch fixes this by just reverting to the stardard cursor instead.

https://bugs.freedesktop.org/show_bug.cgi?id=50487
2012-08-13 14:39:41 -04:00
Kristian Høgsberg
33d7509d37 compositor: Set WAYLAND_DISPLAY only after creating backend
The wayland backend needs to connect to the original WAYLAND_DISPLAY
before we overwrite it.

https://bugs.freedesktop.org/show_bug.cgi?id=53064
2012-08-13 14:34:01 -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
Christopher Michael
ac3e5f2feb Add support in Weston for X cursor themes.
This patch, along with the wayland patch, adds the ability to specify
a cursor theme in the weston.ini file:

[cursors]
theme=THEME_NAME

If specified, than Weston can use a specific X cursor theme for the
pointer. This relies on the 0001-Add-support-for-X-cursor-themes.patch
for wayland.

[krh: edited to use shell section and key name cursor-theme]
2012-08-13 11:12:17 -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
b29798bcab window.c: Rearrange input handlers so they appear in the right order
They were all over the place before, now they appear in protocol order.
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
Jan Arne Petersen
cd8cdccdd3 text: Deactivate text_model on keyboard focus lost
Assign a surface to a text_model on the text_model_activate request and
deactivate the text_model when the surface looses the keyboard focus.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
e829adc514 text: Assign text_model to a wl_seat
Add a wl_seat argument to the activate and deactivate requests of
text_method.

On activation a text_model gets assigned to the input_method of the
wl_seat specified in the activate request.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
de3b6a15c0 text: Add activate/deactivate events
Let the client know when a text model gets activated or deactiavted.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
5196374218 text: Rename text_model_manager to factory
The text_model_manager interface is just used to create text_model
instances. It is more a factory than a manager so rename it to
text_model_factory.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
72f6082313 text: Add missing callbacks for text_model events
Add all required callbacks for the text_model_listener in the editor
example.
2012-08-10 13:00:52 -04:00
Kristian Høgsberg
cb3eaae9ad compositor: Change notify_* function to take a weston_seat
Fewer indirections and derefs, and it's also more appropriate for a
backend calling into weston core to pass a weston_seat.
2012-08-10 13:00:52 -04:00
Kristian Høgsberg
05890dc621 compositor: Don't hardcode output transform when sending the event
We add a transform field to weston_output and backends can override it
when they create the output.
2012-08-10 10:09:20 -04:00
Kristian Høgsberg
16333ab0ab compositor: Remove compositor->seat
Get rid of this quick-and-dirty assumption.
2012-08-10 10:08:21 -04:00
Kristian Høgsberg
ef6f136d65 zoom: Pick the first seat in seat_list instead of compositor->seat 2012-08-10 10:07:55 -04:00
Kristian Høgsberg
5ba31891a1 xwm: Use a simple heuristic for mapping X input events to a weston seat 2012-08-10 10:06:59 -04:00
Kristian Høgsberg
f4d2f237f0 shell: Track pointer focus for all seats 2012-08-10 10:05:39 -04:00
Kristian Høgsberg
4f92c5392a compositor-x11: Move X11 core input seat into x11_compositor
There can only ever be one of these, but keep that assumption in the
X11 backend.
2012-08-10 10:04:36 -04:00
Kristian Høgsberg
7af7cede2d compositor-wayland: Move weston_seat into wayland_input 2012-08-10 10:01:33 -04:00
Kristian Høgsberg
99fd1015d0 compositor: Drop output->flags
All outputs are EGLSurface based so we can drop this detail now.
2012-08-10 09:58:02 -04:00
Kristian Høgsberg
8a01580f17 compositor-drm: Fix bad rebase
I failed to compile test my rebase of Robs compositor-drm fixes.
2012-08-09 17:19:23 -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
Rob Clark
ab5b1e3149 compositor-drm: don't keep trying if hw doesn't support cursors
Not all hw supports hw cursors.  Similar to the case with sprites, if
the driver does not support it, don't keep trying and spamming the log
with error messages.

Signed-off-by: Rob Clark <rob@ti.com>
2012-08-09 17:11:03 -04:00
Rob Clark
4339add9e9 compositor-drm: don't attempt sprite for out of bounds dimensions
The drmModeAddFB2() call will fail anyways, and cause us to unnecessarily
set sprites_are_broken.

Signed-off-by: Rob Clark <rob@ti.com>
2012-08-09 17:08:40 -04:00
Rob Clark
702ffaea3e compositor-drm: skip overlay for shm buffers
They can't be imported by gbm, so no point in trying, and segfaulting
in gbm when we try to import (because it tries to deref the buffer as
a wl_drm_buffer).

Signed-off-by: Rob Clark <rob@ti.com>
2012-08-09 17:05:20 -04:00
Ander Conselvan de Oliveira
42c46466ab compositor-drm: Return the newly added mode in drm_output_add_mode()
Most of the times the caller will look at the output's mode list to get
the new mode, so just return that instead.
2012-08-09 14:40:12 -04:00
Ander Conselvan de Oliveira
dc79e6d289 compositor-drm: Check for OUTPUT_CONFIG_OFF instead of using strcmp()
A call to strcmp() is already made in output_section_done() and
output->config is set appropriately if mode is "off". There is
no need to duplicate that in create_output_for_connector().
2012-08-09 14:39:13 -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
Ander Conselvan de Oliveira
3b70b66fa9 compositor: When redrawing, don't clip opaque regions from other planes
When accumulating damage in the repaint loop, the opaque region of
surfaces in other planes is added to the overall opaque region. This
causes surface->clip to contain the areas obscured by surfaces in
other planes. Change it to contain only the opaque region of surfaces
in the primary plane

This fixes a bug where moving a window that was just moved from the
primary plane to another would leave artifacts on the screen. The
problem was that the damage generated by weston_surface_move_to_plane()
would be clipped on weston_surface_redraw(), leaving the contets below
it unchanged. Moving the overlaid surface would no longer generate
damage on the primary plane, so the contents would remain unchanged
(i.e. wrong) indefinitely.
2012-08-09 13:46:55 -04:00
Rob Bradford
84cf541b27 spring: Avoid excessive calculation loops for the spring values
To handle the case where wall clock time jumps forwards by a large amount or
backwards limit the execution of the spring calculation loop.

We do this by forcing the spring update timestamp to being no older that 1s of
the most current time we've been given. We also present a log message if the
timestamp jumps more than expected.
2012-08-09 12:51:45 -04:00
Rob Clark
5ca1a47e23 compositor-drm: handle vblanks on secondary crtc
Signed-off-by: Rob Clark <rob@ti.com>
2012-08-09 12:47:06 -04:00
Juan Zhao
19a4c2db26 image: Don't segfault when the file doesn't exist
Don't create a window when the file doesn't exist.

https://bugs.freedesktop.org/show_bug.cgi?id=52450
2012-08-09 10:55:40 -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
Pekka Paalanen
3eb4761317 evdev: rename evdev_input_device to evdev_device
As said by krh: "Maybe we should also just call it an evdev_device
instead, shorter [and] not really ambiguous."

[krh: if my typo filled irc is going in a commit message, I'm at least going
to insert the missing words.]

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:29:18 -04:00
Pekka Paalanen
b9d38f4552 evdev: do not pass a list to evdev_led_update()
evdev_led_update() does not really need the whole list of device at
once, it can be called one device at a time.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:28:35 -04:00
Pekka Paalanen
f1fc10a488 compositor: fix weston_log format warnings
compositor.c: In function ‘log_extensions’:
compositor.c:3085:7: warning: field precision should have type ‘int’,
but argument 2 has type ‘long int’
compositor.c:3087:4: warning: field precision should have type ‘int’,
but argument 2 has type ‘long int’

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:27:39 -04:00
Pekka Paalanen
ae29da2eb8 compositor-drm: fix weston_log format errors
compositor-drm.c: In function 'drm_output_set_cursor':
compositor-drm.c:754:4: warning: too few arguments for format
compositor-drm.c:759:4: warning: too few arguments for format

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:27:34 -04:00
Pekka Paalanen
d525b564ae compositor: format check for weston_log arguments
Add gcc format check attribute to the weston_log() and
weston_log_continue() functions.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:27:28 -04:00
Pekka Paalanen
df1fd36a14 compositor: log program launches
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-09 10:27:21 -04:00
Scott Moreau
ca9b09d945 compositor-x11: Always free output_mode on error. 2012-08-09 10:23:26 -04:00
Kristian Høgsberg
3d89049546 config-parser: Handle lines that don't end in \n
If the last line in a config file doesn't have a newline
we end up chopping off the last character from that line.
2012-08-03 21:56:41 -04:00
Scott Moreau
248aaecda2 compositor-x11: Allow output configuration from config file.
This patch provides a way to define outputs for the x11 backend. It
parses [output] sections and checks for 'name' and 'mode' keys. The
'name' must start with an 'X' to distinguish from drm output names.
Command line options --width and --height supersede what is in the
config file. When --output-count is passed, the number of outputs
are limited or additional outputs added with default values.
2012-08-03 20:17:47 -04:00
Scott Moreau
a5021521f1 compositor: Always set output_mask in weston_surface_update_output_mask().
Commit 982387011 causes a bug where starting weston results in a black screen
(if no clients are immediately started). The problem is that the offending
commit causes the compositor to not damage if a surface has an empty output
mask, which is the case for the fade surface, which is created by the
compositor.  This patch updates the surface output_mask unconditionally,
and only skips sending out the events if there no client.
2012-08-03 20:11:24 -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
982387011f compositor: Add weston_surface_schedule_repaint() for limited repaint
In cases where we know the surface bounding box doesn't change in the
next frame, we can limit redraws to only the outputs the surface is
currently on.  We could do even better by forcing the transform
update so we know where the surface will be in the next frame, but
this is a much simpler first step.
2012-08-03 16:36:52 -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
bcf4864bb7 simple-egl: Add help message 2012-08-03 16:32:55 -04:00