Commit Graph

2432 Commits

Author SHA1 Message Date
Pekka Paalanen
0cbd3b5059 compositor, clients: double-buffer input region
Make input region double-buffered as specified in the new protocol.

While doing it, get rid of the undef region code, and instead use a
maximum sized real pixman region. This avoids special-casing regions
that might sometimes be undef.

As the input region is now usable by default instead of undef,
weston_surface_update_transform() does not need to reset the input
region anymore.

weston_surface_attach() no longer resets the input region on surface
size change. Therefore, also weston_seat_update_drag_surface() does not
need to reset it.

Update toytoolkit to set input region before calling wl_surface_commit()
or swapBuffers (which does commit).

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:44 -04:00
Pekka Paalanen
512dde8ce9 compositor, clients: double-buffer opaque region
Make wl_surface.set_opaque_region double-buffered as required by the new
protocol. Also, do not reset the opaque region on surface size changes
anymore. Only explicit requests from the client will change the region
now.

In clients, make sure commit happens after setting the opaque region.

Mesa does not need a fix, as it never touches the opaque region.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:40 -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
Pekka Paalanen
8e159180cc compositor, clients: make damage double-buffered
This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".

Implement double-buffering of damage in the compositor as required by
the new protocol.

Ensure all Weston demo clients call wl_surface_commit() after
wl_surface_damage().

Mesa does not need a fix for this, as the patch adding
wl_surface_commit() call to Mesa already takes care of damage, too;
Mesa commit: "wayland: use wl_surface_commit()"

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:31 -04:00
Pekka Paalanen
c9e00c06e9 clients: use wl_surface_commit
Use wl_surface_commit() to commit the buffer attach, as Weston now
requires.

NOTE: GL-applications are broken until you upgrade to a version of Mesa
which does wl_surface_commit() on eglSwapBuffers(). If you have
Cairo-gl, this means all toytoolkit apps, too.

simple-shm and simple-touch OTOH will work now.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:17 -04:00
Pekka Paalanen
5df44de6a9 compositor: make wl_surface.attach double-buffered
This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".

Clients are now required to issue wl_surface.commit for the
wl_surface.attach to take effect.

While changing this, change the surface argument to
weston_surface_attach() from wl_surface into weston_surface, for
consistency.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:00 -04:00
Kristian Høgsberg
fa80e11c84 Update to new fd and wl_registry APIs
This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
2012-10-10 21:34:38 -04:00
Scott Moreau
4e07236e87 toytoolkit: Take into account transform when sending output allocation. 2012-10-10 13:02:11 -04:00
Kristian Høgsberg
b36f7ef99e terminal: Don't snap resize if we're maximized
We allow fullscreen to fill the requested size, do the same for maximize.
2012-10-10 11:41:21 -04:00
Kristian Høgsberg
b7ed4cbbc7 terminal: Use window_get_fullscreen() instead of tracking that state manually 2012-10-10 11:37:46 -04:00
Kristian Høgsberg
1671e1129d window: Add getters for fullscreen and maximized state
This lets us eliminate a bit of redundancy in the clienst where they track
fullscreen state themselves.
2012-10-10 11:36:24 -04:00
Scott Moreau
c6a7e4b277 toytoolkit: Don't draw shadows for maximized windows.
Add THEME_FRAME_MAXIMIZED flag so the theming system can know not to draw
shadows for maximized windows. This allows maximized surfaces' content to be
sized and placed in a more expectable fashion.
2012-10-10 11:23:41 -04:00
John Kåre Alsaker
c37b32dac2 compositor-wayland: Use some nicer border sizes. 2012-10-09 23:17:46 -04:00
John Kåre Alsaker
b9b87125f0 compositor-wayland: Make sure border fields are set before wayland_compositor_create_output and document some function dependencies. 2012-10-09 23:17:34 -04:00
Scott Moreau
01a9f1b992 clients: Set title for all shell surface demos. 2012-10-09 23:13:01 -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
Rob Bradford
a6b63d0f67 backlight: Jump to cleanup code if synthesizing backlight string fails
This applies the same pattern as used in other error cases in this block - and
cleans up the file desciptors and allocated memory too.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:57:10 -04:00
Rob Bradford
6b6795f070 compositor-drm: Avoid leak during output configuration error path
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:56:56 -04:00
Rob Bradford
053fe7652b keyboard: Avoid access beyond end off buffer
If the for loop does not match on a button it will fall through and try and
dereference into the array using the terminating value of the loop. This
terminating value of the loop is the dimension of the array and thus beyond
its bounds.

Cc: Jan Arne Petersen <jpetersen@openismus.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:56:46 -04:00
Rob Bradford
273fec8ede backlight: Avoid buffer overflow in the use of readlink
readlink() returns the number of bytes that it has written excluding any NUL
byte (since it does not write that itself.) This could lead to attempting to
access beyond the end of buffer if the destination of the link is exactly 100
bytes long. The standard solution to this is to subtract one from the buffer
when passing it into readlink().

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:55:07 -04:00
Rob Bradford
ec913fdfde evdev-touchpad: Iterate over the touchpad spec table correctly
The original code would overrun since the calculation of the range did not
take into consideration the size of the entries in the table.

Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:55:07 -04:00
Rob Bradford
4b997e45e7 evdev: Avoid unintended case drop through
e->code is in the same range for ABS_ and for REL_. As the code currently
stands and for the current values in Linux's input.h there is no risk of a
problem. However just in case it would be wise to break after evaluating the
relative events.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:50:42 -04:00
Rob Bradford
592c07a6b9 tty: Log error if we cannot setup a valid tty keyboard mode
The previous logging code would never be reached - this change makes sure a
message is reported if changing keyboard mode to either the desired (K_OFF) or
fallback (K_RAW with handler that drops the events) fails.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:50:13 -04:00
Rob Bradford
3de191e6b0 evdev-touchpad: Twiddle finger_state correctly
The original code always set the finger_state to the appropriate bitmask
irrespective of whether the event was a press or a release. It would also blat
all members of the bitmask rather than ORing in the new bit for the event.

Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:49:25 -04:00
Jonas Ådahl
f77beeb981 window: Initialize workspace state before first roundtrip
The workspace state parameters were initialized after the first
roundtrip. If a workspace manager state event was received during this
roundtrip the state parameters were cleared leaving an incorrect state.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-09 22:47:24 -04:00
John Kåre Alsaker
71c474416a tests: Remove GLfloat usage. 2012-10-04 12:28:04 -04:00
John Kåre Alsaker
490d02a96d weston: Use float instead of GLfloat. 2012-10-04 12:27:21 -04:00
John Kåre Alsaker
4b3081ae8a compositor-wayland: Create border after creating the OpenGL context. 2012-10-04 11:51:50 -04:00
U. Artie Eoff
840d5f975b tests: add keyboard test
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:40:57 -04:00
U. Artie Eoff
58990cae31 tests: add button test
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:40:04 -04:00
U. Artie Eoff
d690175a22 tests: test surface to/from global functions
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:39:59 -04:00
U. Artie Eoff
1ae298f9d9 event-test: more aggressive event testing
Test surface pointer enter/leave/motion and surface leave/enter
events more aggressively.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:39:55 -04:00
U. Artie Eoff
44874d9f02 desktop-shell: destroy data before exiting.
desktop-shell never returned from display_run() since it
was essentially killed when weston exited.  To fix this,
it is necessary to watch for EPOLLHUP in window.c so that
toytoolkit clients will return from display_run() when
weston quits.  This allows for clients to clean up
as needed.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:37:40 -04:00
Rob Bradford
371805f76e simple-shm: Draw the test motif surrounded by a white border
We can then use a wl_surface_damage to just trigger the compositor to update
just a selected region of the buffer and thus test damaging a sub region.
2012-10-04 11:34:09 -04:00
Rob Bradford
fecf332e19 simple-shm: Don't attach the buffer to the surface for every redraw
This will allow us to change just a sub region of the buffer.
2012-10-04 11:34:05 -04:00
Philipp Brüschweiler
70f83679ee editor: more intuitive cursor positioning
Compute the nearest glyph edge instead of taking the one to the
left of the cursor.

Also fixes a segfault when trying to compute the position for an empty
buffer.
2012-10-04 11:31:21 -04:00
Philipp Brüschweiler
9f897c7a5f editor: take text offset into account when computing cursor position 2012-10-04 11:31:19 -04:00
Philipp Brüschweiler
b8911dcdd7 editor: make selection a lighter shade of blue, much easier to read 2012-10-04 11:31:17 -04:00
Philipp Brüschweiler
237358be93 editor: fix assert to take preedit string into account 2012-10-04 11:31:14 -04:00
Martin Olsson
3b132e358f Fix spelling errors 2012-10-04 11:24:50 -04:00
Tiago Vignatti
0d20d7c8f4 xwm: Plug kill signal for killing X apps
Xeyes is the counter-example that fails on that heuristic and won't be caught
on kill binding. This and the last two patches should fix:

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

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-04 11:07:50 -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
Tiago Vignatti
6f09338b0f toytoolkit: Process deferred tasks on fifo order instead
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-09-27 21:23:34 -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
Pekka Vuorela
4e363d21bb Require mouse release on top of frame button to trigger action
As common UI convention, allows action to be avoided by dragging
outside the button after mouse press.
2012-09-26 11:22:30 -04:00
Rob Bradford
9b1018702d compositor-drm: Check that that we have a valid bo for scanout
If gbm_bo_import does not return a valid buffer for usage of
GBM_BO_USE_SCANOUT don't try and scan out the surface directly.

We've caught the SHM case explicitly earlier - this is to prevent other cases
where the bo cannot be scanned out.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-09-26 11:19:50 -04:00
Pekka Vuorela
6e1e385d51 Protect window callbacks from deleted windows
Calling window_destroy() was able to cause segfault for
callbacks triggering afterwards.
2012-09-26 10:20:32 -04:00
Kristian Høgsberg
b9af479f02 compositor: Make weston_surface_assign_output() static
This is now done as part of weston_surface_update_transform().
2012-09-25 14:48:04 -04:00