Commit Graph

3500 Commits

Author SHA1 Message Date
Kristian Høgsberg
e8344e3dbc nested: Cast away warnings for differing arguments to eglQueryWaylandBufferWL 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
6773394000 nested: Free client struct on launch_client error paths 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
f1144dd0dc nested-client: Exit if we fail to create the nested client struct 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
b24d590e8f multi-resource: Use xzmalloc() instead of malloc+memset and calloc 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
74b0d72817 launcher: Remove left-over debug logging 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
d58e395bf2 tablet-shell: Avoid leaking icon or path strings from invalid launcher section 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
b5c973c8c2 window.c: Free cursor theme name once we're done with it 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
af393dcc69 weston-launch: Only store drm fd if we successfully opened and stat'ed it 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
4a74d5a4a4 launcher: Don't leak tty file descriptor on error 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
325390e529 launcher: Don't leak tty file descriptor on launcher destroy 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
8ac6a2da07 compositor-fbdev: Fix a fd leak in the fbdev backend
fbdev_frame_buffer_map() closes the fb fd, so we have to close it
manually in case we're using the hybris renderer (ie !pixman).
2013-10-10 16:50:18 -07:00
Kristian Høgsberg
95659c0321 configure.ac: Bump version to 1.3 2013-10-09 16:20:50 -07:00
Kristian Høgsberg
6a11a8ab54 Revert "Resize the shell when the mode is switched"
This breaks panel resizing as it doesn't account for output rotation.

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

This reverts commit a356f7b1ef.
2013-10-09 15:23:16 -07:00
Kristian Høgsberg
cb406f1afd input: Don't send modifiers if client doesn't have a pointer resource
This fixes an uninitialized serial error, were we could send out the
modifier event even if the client didn't have a pointer resource.  We
send out the modifier event to let clients know the modifer mask when
they receive a pointer button event.  Thus, if the client doesn't have
a pointer we don't need to send the modifier event.

Additionally we would send out the modifier event with an
uninitialized serial number.

Finally, this commit restores the order of sending the modifier event
before the enter, like it used to be.  Not likely to be an issue,
since the client will always receive the modifier event before any
button event, but it's a little nicer to give the client the modifier
events before it receives any pointer events.
2013-10-09 15:01:18 -07:00
Tomeu Vizoso
b4659eb159 rpi: Add support for EGL buffers
The EGL implementation on the RPi allocates a front and a back
DispmanX resources for each EGLSurface, which we composite along
the others.
2013-10-08 11:19:25 -07:00
Kristian Høgsberg
8d7bef2673 configure.ac: Bump version to 1.2.92 2013-10-02 22:14:23 -07:00
Kristian Høgsberg
e05f228a5f launcher: Print a more descriptive error message when we don't get a VT
weston-launch has two supported use cases now: either launch from
and VT login as a regular user (running within that session) or
from an init script (systemd or such) with the -u option to create
a session for the specified user.  Running from within X or ssh is
not possible.  It's still possible to run weston as root from X or ssh
but that's strictly a development/debug/test feature.

https://bugs.freedesktop.org/show_bug.cgi?id=69727
2013-10-02 13:06:02 -07:00
Kristian Høgsberg
6ff3ff57aa launcher: Add back support for specifying VT to run on
This is only available when running weston directly as root typically for
ssh logins.  It's a somewhat destructive option, as it will take over any
existing VT completely, unless there's already an display server running
there.

https://bugs.freedesktop.org/show_bug.cgi?id=69731
2013-10-02 11:47:28 -07:00
Kristian Høgsberg
1468e60647 launcher: Bail out if we can't be drm master
If we can't be drm master, we won't be able to do anything useful with
the drm device.
2013-10-02 10:49:05 -07:00
Kristian Høgsberg
57a10e4d13 launcher: Set make sure we're drm master when opening the drm device
In case we try to run on a tty where some other process is already
drm master, back off and exit with an error message.
2013-10-01 15:37:09 -07:00
Kristian Høgsberg
19ec77aef7 launcher: Fail weston_launcher_create() if tty setup fails 2013-10-01 12:54:55 -07:00
Neil Roberts
8b62e2043a Set new state before emitting wake signal in weston_compsitor_wake
The wake handler set up by the shell will try to unlock the screen
which works by setting up an animation which fades in the display. The
animation is started by first scheduling a repaint. Subsequent
repaints are scheduled whenever the previous frame is finished.
However in the case of the wake up signal the state is still
WESTON_COMPOSITOR_SLEEPING when the animation is started.
weston_output_schedule_repaint() ignores attempts to schedule a
repaint if the compositor is sleeping which means the animation never
gets run and will never complete.

The animation gets unstuck and continues if anything else schedules a
repaint after the state has been changed so the bug only gets hit in
certain conditions. The first wake up creates the lock surface which
causes a redraw when the first buffer is attached so the first wake up
is always ok. A redraw can be triggered in the subsequent wake ups
just by moving the mouse.

A good way to trigger the bug is to try to wake up the compositor by
pressing the shift key. If you let the compositor go back to sleep
after waking it up without unlocking it, the second press of the shift
key will not cause a redraw so the animation will not run and it won't
fade in.

https://bugs.freedesktop.org/show_bug.cgi?id=69719
2013-10-01 10:56:34 -07:00
Tomeu Vizoso
1b45e5edd1 weston-egl: Update weston-egl-ext.h: s/wl_buffer/wl_resource
As struct wl_buffer has been deprecated since 1.2.
2013-10-01 10:42:55 -07:00
Tomeu Vizoso
d7865b2f75 weston-launch: Only drop privileges if running as root 2013-10-01 10:41:59 -07:00
Aaron Faanes
9cefc647cc compositor: fix typo in error message 2013-10-01 10:32:02 -07:00
Adrian Negreanu
908e6d0b8f launcher-util: pull in drm only for compositor-drm
Add drm_set_master and drm_drop_master
as wrappers for drm(Set|Drop)Master, when building compositor-drm
or as empty functions otherwise.

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-09-30 15:38:15 -07:00
Hardening
a356f7b1ef Resize the shell when the mode is switched
Resize the panel and the background when we're notified of a mode
switch.
2013-09-29 14:23:54 -07:00
Alexandru DAMIAN
5f42930a41 config: Don't crash if we don't have a config file
Adding a check in weston_config_full_path so that
we don't crash if we started without a config file.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-09-26 16:24:33 -07:00
Adrian Negreanu
7b8e970ad1 compositor-fbdev: drop dependency on libdrm
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-09-26 16:18:13 -07:00
Alexandru DAMIAN
840a421a5e compositor: check if seteuid worked
Checking the return value from seteuid in
order to not launch clients with the wrong effective uid.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-09-26 16:18:11 -07:00
Kristian Høgsberg
c3ea26c02d compositor-drm: Match the EGLConfig native visual ID if it has one
We'll add the GBM format code as the native visual ID for EGLConfigs
when running on GBM.  This patch lets the drm backend pass in the
format code it's using with KMS and make sure we get a confing that
matches.  In the future, mesa will add support for 10 bpc configs
which will match the "at least 8 color bits" requirement.  By also
matching the native visual ID, we avoid rendering XRGB2101010 into a
XRGB8888 KMS framebuffer.
2013-09-26 14:38:14 -07:00
Neil Roberts
be336c8918 evdev: Process touch up events of single-touch devices
Previously only the touch up key event was used for single-touch
devices and the touch down event was generated on the first motion
event. This was breaking if the touch up and down events were sent
without a motion in-between because the evdev driver wouldn't generate
a touch down event and Weston would lose track of the number of touch
points that are down. This patch changes it to track the up and down
key events as pending events similar to how it does for multi-touch
devices.

https://bugs.freedesktop.org/show_bug.cgi?id=69759
2013-09-24 16:22:43 -07:00
Neil Roberts
daf7d4774b evdev: Only track one pending event
Instead of having a mask of pending events there is now an enum with a
single value to represent the one pending event. The event gets
flushed explicitly as part of the handling code for each event type
rather than in the outer event reading loop. The pending event is used
so that we can combine multiple motion events into one and to make
sure that we have recieved the latest position before sending a touch
up or down event. This should fix the following problems with the old
approach:

• If you release a finger and press it down again quickly you could
  get the up and down events in the same batch. However the pending
  events were always processed in the order down then up so it would
  end up notifying two down events and then an up. The pending event
  is now always flushed when there is a new up or down event so they
  will always be in the right order.

• When it got a slot event it would immediately change the slot number
  and then set the pending event. Then when it flushed the events it
  would use the new slot number to flush the old pending event so the
  events could have the wrong finger. The pending event is now
  immediately flushed when a slot event is received so it will have
  the right finger.

• If you get more than 32 events in one read then it was resetting the
  pending events before processing the next batch in
  evdev_process_events. If four fingers were pressed down at once then
  it ended up with more than 32 events and the sync message would be
  in the second batch. The pending flag for the last finger was
  getting cleared so it never got emitted. In this patch the pending
  event is no longer reset after reading nor is it explicitly flushed.
  Instead it is flushed when we receive a EV_SYN event or a different
  pending event needs to replace it.

The touchpad handling code was trying to use the pending event
mechanism to notify the relative motion events. I'm not sure why it
was doing this because it looks the event would effectively get
emitted as soon as the touchpad_process function is finished anyway
and it wasn't accumulating the values. Instead I've just changed it to
emit the event directly.

https://bugs.freedesktop.org/show_bug.cgi?id=67563
2013-09-24 16:22:19 -07:00
Pier Luigi Fiorini
d0a7282876 version.h: Add version check macro
Make it easier to check for a Weston version.
2013-09-23 10:42:19 -07:00
Stefan Schmidt
639fd86493 clients: Include and link against math lib for new multi-resource
Linking failed with missing ceil() here. Making sure that we include
the header and add the missing -lm.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-09-23 10:10:48 -07:00
Giulio Camuffo
0481054c58 input: check that the new focus surface has a valid resource
Here too we must make sure the surface has a valid resource, as
there are some (xwayland, surfaces created by the shell) that
don't have it.
Fix a Weston crash when setting a mpv window fullscreen on drm.
2013-09-23 10:09:37 -07:00
Emilio Pozuelo Monfort
7f951e1117 Update .gitignore 2013-09-23 10:08:03 -07:00
Emilio Pozuelo Monfort
f62f88fbcd weston.ini: update path for the flower client 2013-09-23 10:07:48 -07:00
Kristian Høgsberg
779938596d configure.ac: Update version to 1.2.91 2013-09-22 14:28:38 -07:00
Kristian Høgsberg
03cc35405e Add vaapi-recorder.h to SOURCES to fix distcheck 2013-09-22 14:28:38 -07:00
Neil Roberts
f65c486090 evdev: Flush motion events when the slot changes, not just after sync
If two fingers are released almost simultaneously then evdev can send
the touch up events in one bunch without sending a sync event
in-between. However, the evdev_device struct only keeps track of one
pending touch up event so in this case the second touch up event would
override the first and it would be lost. This patch changes it to also
flush the events whenever the slot changes so that it will flush the
previous touch up event before trying to queue the next one.

https://bugs.freedesktop.org/show_bug.cgi?id=67563
2013-09-22 13:58:33 -07:00
Giulio Camuffo
4df790e505 compositor: when unmapping a surface remove it from the compositor's list
compositor.surface_list is recreated every redraw with the mapped
surfaces, but if a surface gets unmapped and then in the same frame
weston_compositor_pick_surface() is called we must make sure it
does not pick the unmapped surface, since it traverses the
surface_list to find one.
If after the unmap the surface gets also deleted it's even more
important, as it must not pick a destroyed surface.
2013-09-22 13:39:45 -07:00
Kristian Høgsberg
eeefc9e311 compositor: Log the full path of the config file we're using 2013-09-21 23:17:35 -07:00
Kristian Høgsberg
1abe0486bb config-parser: Make weston_config_parse() tkae a file name
Take a basename of the config file to parse instead of an fd.
2013-09-21 23:05:45 -07:00
Kristian Høgsberg
81c2c2eb5e shared: Remove no longer used parse_config_file() 2013-09-21 23:05:12 -07:00
Kristian Høgsberg
b159560da2 tablet-shell: Use new weston_config instead of old config parse 2013-09-21 22:35:13 -07:00
Kristian Høgsberg
8c079ae052 window.c: Port to use weston_config instead of old parser 2013-09-21 22:26:10 -07:00
Kristian Høgsberg
9c3dee18ce terminal: Port to new weston_config parse 2013-09-21 22:23:08 -07:00
Kristian Høgsberg
b12e35617c compositor: Unlink unmapped surface instead of rebuilding surface list
When unmap and destroy a surface we need to make sure we don't pick it
before we rebuild the new surface list.  Currently we ensure this
by rebuilding the surface list when destroying a surface, but just
removing the surface should be enough.
2013-09-21 21:26:05 -07:00
Giulio Camuffo
1cf329bff1 xwm: remove the destroy listener from the old surface signal 2013-09-21 20:58:53 -07:00