Commit graph

2662 commits

Author SHA1 Message Date
Daniel Stone c31f3dd679 SHM: Don't flush damage when there is none
Every single frame, we were calling the flush_damage handler in the
renderer.  For GLES2 with subimage, this wasn't too bad as we'd never
call glTexSubImage2D, but without it, we'd upload the entire frame
through glTexImage2D every time.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-08 11:31:37 -05:00
Daniel Stone 8097274ce6 Clients: Don't set the cursor when we have no pointer
Avoids a segfault whenever we get a key event, and try to set the
cursor, dereferencing a NULL input->pointer.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-08 11:31:37 -05:00
Kristian Høgsberg 0f7a285fe1 window.c: Move misplaced break to where it belongs
The break statement wasn't copy and pasted along with the rest of the code
causing menu item before it ("Move to workspace below") to fall through to
the fullscreen case.
2012-11-05 20:24:32 -05:00
Kristian Høgsberg de37d67ac5 compositor-drm: Always disable sprites for now
Until the nuclear pageflip work lands in KMS, we can't use sprites
reliably.
2012-11-02 15:19:02 -04:00
Ran Benita 7109cc8b06 compositor-x11: verify that detectable repeat was really set
Since the XKB says that support for detectable repeat is in fact
optional:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Querying_and_Changing_Per_Client_Flags
we might as well be good citizens and check that it was really set. With
the X server this would never happen, though.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-01 11:14:04 -04:00
Ran Benita 6a39d8790e compositor-x11: properly initialize XKB extension
In order to use XKB capabilities (as we do), the client must issue an
XkbUseExtension request:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Initializing_the_X_Keyboard_Extension

The reason this succeeds currently is that XOpenDisplay from Xlib does
this for us. But it is better not to rely on that, but do it explicitly
in XCB with the rest of the XKB init sequence.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-01 11:13:35 -04:00
Ran Benita 7b5e3cd9b1 compositor-x11: free or discard XCB generic_error's
Where we don't look at the error details, pass NULL to the 'error'
argument and test using the reply return value instead.
Where we do need it, remember to free it.

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-11-01 11:12:14 -04:00
Ander Conselvan de Oliveira da1c908a2b compositor-drm: Add key binding for hidding overlays
Pressing ctrl-alt-o will cause the overlays to be hidden, but surfaces
will still be assigned to different planes. This helps with debugging
of repaint culling below surfaces in other planes.
2012-10-31 13:37:23 -04:00
Ander Conselvan de Oliveira 4bcf3a5fce compositor: Fix culling of repaints behind opaque surfaces
Culling of the repaint of a surface behind an opaque surface on the
same plane was broken by commit 547149a9 [1]. The idea of that commit
is that the damage obscured by an overlay would remain on the primary
plane damage and be repainted when the overlay moved. However, in the
case the two surfaces are on the same plane, the opaque one is not
obscured, so it ends up being repainted.

This commit adds an opaque field to struct weston_plane, that is built
incrementally when accumulating damage. The opaque region of surfaces
on the same plane are removed from the plane's damage, restoring the
previous culling behavior. But since damage behind opaque region of
other planes is maintained, the bug solved in the mentioned commit is
not regressed.

https://bugs.freedesktop.org/show_bug.cgi?id=56537
2012-10-31 13:37:01 -04:00
Ran Benita 424ae0151e compositor-x11: use _checked() with xkb_select_events to test for error
In order to use xcb_request_check(), given a request without a reply,
you need to use the _checked() variant of the request function.
See xcb-requests(3).

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-10-31 10:50:40 -04:00
Kristian Høgsberg e77d7577a2 window: Fix use-after-free in menu button handler
Commit d2fbb3870c introduced a use-after-free
error in the case where we destroy the menu.
2012-10-30 18:10:32 -04:00
Kristian Høgsberg efb948846f window: Only advertise fullscreen menu item if client supports it
If the client doesn't set a fullscreen handler, we can't go fullscreen
and shouldn't advertise that in the window menu.  The menu implementation is
a little simplistic, so we just move the "Fullscreen" entry to the end of
the list and don't count it if we don't want it in the menu.

https://bugs.freedesktop.org/show_bug.cgi?id=47751
https://bugs.freedesktop.org/show_bug.cgi?id=48106
2012-10-30 18:07:02 -04:00
Kristian Høgsberg 9468708f70 image: Set dragging pointer on button press, not first motion
We want feedback that we're starting to drag when we press the button
not when we later start dragging the image.
2012-10-30 15:50:37 -04:00
Kristian Høgsberg d3bf6766ab image: Combine clamp_view() and center_view ()
We need to clamp or center on a per axis basis.  If the window is wider
but the image is taller, we need to center horizontally but
clamp vertically.  We can only do that if by combining the two
functions.
2012-10-30 15:46:39 -04:00
Kristian Høgsberg 719b2158e7 image: Add keyhandler to handle keyboard zoom 2012-10-30 15:42:20 -04:00
Kristian Høgsberg a369ff5273 image: Set resize handler and center view on resize/fullscreen 2012-10-30 15:09:49 -04:00
Scott Moreau 1bdb477522 toytoolkit: Don't destroy window cairo surface on shm attach.
https://bugs.freedesktop.org/show_bug.cgi?id=52454
2012-10-30 14:18:49 -04: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
Ander Conselvan de Oliveira 5df8ecac5d compositor: Fix partial repaints
Partial repaints have been broken since the introduction of the atomic
surface updates. The problem was that surface_commit would set the
geometry dirty flag unconditionally, causing transform updates on every
frame which would in turn cause weston_surface_damage_below() to damage
the whole surface area.

This patch changes this so that flag is only set if the pending buffer
has a different size, the location of the surface changed or the opaque
region changed.

Note that changing the opaque region will cause a full repaint of the
affected surface, because of the transform update.

https://bugs.freedesktop.org/show_bug.cgi?id=56538
2012-10-30 13:53:51 -04:00
Kristian Høgsberg d2fbb3870c window: Make press-drag-release menu selection mode work
The intended behavior is that a quick click (press and then release
within 500ms) just pops up the menu and doesn't select anything.  Then
we can mouse around and and click to select an item.  Alternatively, a
click and hold (ie press and release after 500ms) lets you press right
button, mouse down on the menu item you want and release to select it.
This is how menus work in most toolkits.

The handling in weston is fine, it's there to handle the case where
the button release happens outside any client window, since the client
doesn't get those events.  If such a release happens late or we get a
second release outside the popup window we shut down the popup.

The problem is in toytoolkit, where we need to select the item if we
get a release within 500ms or if we get a second release.  A second
release is the case where the first release came after 500ms and
didn't pop down the menu, and the second release event is from a click
on a menu item.

https://bugs.freedesktop.org/show_bug.cgi?id=52456
2012-10-30 13:45:31 -04:00
Kristian Høgsberg 7330862f9e compositor-x11: Grab pointer on button press, ungrab on release
This lets us confine the X pointer to the Weston X window, which corresponds
better with the rendered Wayland cursor actually moves.

https://bugs.freedesktop.org/show_bug.cgi?id=53558
2012-10-30 11:04:54 -04:00
Kristian Høgsberg 191e0eee77 simple-egl: Add a default cursor
If clients don't set a cursor, they get whatever the last cursor was
before the pointer entered their window.  That's a little confusing, so
set a pointer on enter to avoid that.  The down-side is that simple EGL
isn't very simple anymore.

https://bugs.freedesktop.org/show_bug.cgi?id=52452
2012-10-29 17:41:46 -04:00
Kristian Høgsberg 6326c5de82 clients: Remove $(toolkit_libs) from weston_screensaver_CFLAGS
The typo that broke the build.
2012-10-29 17:15:54 -04:00
Kristian Høgsberg e530a0a240 window: Ignore input_set_pointer_image() if we don't have a pointer
https://bugs.freedesktop.org/show_bug.cgi?id=55782
2012-10-29 16:42:26 -04:00
David Herrmann 0af066ff25 compositor-drm: prefer PCI boot_vga GPU over other GPUs
If we can find a boot_vga PCI GPU, we should prefer it over any other GPU
that is connected to the system. The boot_vga flag tells us that this GPU
is the primary system GPU.

This fixes problems on two-GPU-systems were the wrong GPU is used. It also
fixes systems were DisplayLink GPUs are available with lower IDs than PCI
GPUs (although, this seems unlikely).

Note that udev_enumerate guarantees that the entry-list is sorted. So for
systems that have platform-GPUs, these should almost always be reported
prior to hotpluggable (PCI, USB, ...) GPUs, as the kernel probes them
first.

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

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-29 16:31:38 -04:00
Damien Lespiau 4df7e27055 dnd: Use %zd in the format string for size_t types
len i size_t, so is the result of the sizeof operator.
2012-10-29 16:28:19 -04:00
Kristian Høgsberg aac8693cf3 compositor-x11: Inherit initial modifier state from XKB
https://bugs.freedesktop.org/show_bug.cgi?id=52419
2012-10-29 14:15:40 -04:00
Tiago Vignatti 5643aa5840 man: Update XCURSOR_* information a bit
This and the previous patch should fix:

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

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-29 13:44:33 -04:00
Tiago Vignatti ac78bb1017 xwm: Fail safely if cursor is not found
It will use the stock 'x' cursor instead when the system cursors are not
provided.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-29 13:44:33 -04:00
Kristian Høgsberg b98905e810 configure.ac: Check for libGLU for screensaver
https://bugs.freedesktop.org/show_bug.cgi?id=56376
2012-10-29 13:44:33 -04:00
Pekka Paalanen 16b41e442b Add informal notes file
By request on the wayland-devel mailing list, we could start collecting
useful writings here.

However, this is not meant to be a substitute to proper documentation,
though I understand it may very well become one. Better than nothing, I
guess, and hopefully helps in writing real documentation.

Feel free to add stuff.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 15:00:42 -04:00
Pekka Paalanen 9249f93057 compositor-drm: remove a stale comment
This comment became stale in:

commit 65a11e1039
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Fri Aug 3 11:30:18 2012 -0400

    compositor: Accumulate damage per plane

Now it is just misleading. Remove it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:59:30 -04:00
Pekka Paalanen 9564c75163 desktop-shell: background should be opaque
Toytoolkit does not support setting opaqueness for anything else than
the immediate child widget of the frame widget. Backgrounds do not have
frames, so we need to poke it in manually.

This should allow Weston to paint the background without blending.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:59:23 -04:00
Pekka Paalanen fedc527723 window: remove window_set_transparent() declaration
The function is not implemented.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:59:08 -04:00
Pekka Paalanen 035a0323ef gles2: check eglBindWaylandDisplayWL return value
If the bind fails, do not bother pretending the EGL Wayland extension
is usable, and no need to unbind, either.

Print some important details about the GLESv2 renderer configuration
into the log.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:58:59 -04:00
Pekka Paalanen 9c3fe25b4d gles2: log EGL config info
Interesting in new environments.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:57:17 -04:00
Kristian Høgsberg 00fbbe6b60 compositor: Clip pointer coordinates on pointer enter as well
When tiling window managers resize a non-resizable window they're violating
ICCCM.  Not some hippie-community standard like EWMH, but ICCCM, which is
about as old and sacred as the constitution.  If they want to force a window
to be a size it wasn't designed for, at least they could have the decency to
reparent the client window into a bigger containing window of whatever size
they think it should be.  But apparently ICCCM compliance is too much to ask.

Anyway, all that just to say that it's really not our fault when we get an
enter event with coordinates outside the valid output region.  But we'll
clip it anyway and work around mis-behaving tiling WMs.
2012-10-24 09:54:42 -04:00
Kristian Høgsberg 42470cfc49 configure.ac: Bump version to 1.0.0 2012-10-22 18:50:03 -04:00
Kristian Høgsberg 128ee2c342 test-client: Make sure we process pending eevents before we verify state
Since the send-button-state request comes in on one socket and the
wayland event we're looking for comes in on another socket, the order
that we process the two in is undefined.  Thus, button-test fails
intermittently, depending on which event we process first.

We change wl_display_flush() to wl_display_roundtrip(), to make sure that
we deal with all wayland events before handling test protocol requests.
2012-10-21 22:30:26 -04:00
Kristian Høgsberg 1d1e0a5ffa compositor-drm: Disable hw cursor if allocation fails
Instead of crashing later, we can just fall back to gl rendered cursors.
2012-10-21 13:29:26 -04:00
Kristian Høgsberg 8c31a4c025 Define our own container_of as well
Don't rely on libwayland-client/server to define this for us.
2012-10-19 23:05:37 -04:00
Kristian Høgsberg 5717b6dbf1 Stop relying on ARRAY_LENGTH being defined in wayland-util.h
Time to break a bad habit.
2012-10-19 17:12:38 -04:00
Jonas Ådahl f461eee2b0 window: Always pass focused widget to widget motion handlers
Grabbed widgets should always receive motion events as if it was the
widget that would receive it if no grab was active. This means that the
focused widget should always be passed as the widget argument to widget
motion handlers.

This reverts commit 8c9c8fcf6e.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-19 16:56:08 -04:00
Jonas Ådahl f82eda5247 window: Don't set pointer image when requesting to move a surface
Since it's the server who moves the surface it's the server who sets the
pointer image.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-19 16:54:42 -04:00
Ander Conselvan de Oliveira d0f24cf6ec simple-shm: Don't use ret variable in main() uninitialized 2012-10-17 16:51:07 -04:00
Kristian Høgsberg 3146756adf clients: Don't ask for EGL_PIXMAP_BIT when choosing configs 2012-10-16 15:31:31 -04:00
Kristian Høgsberg a17f7a13fd clients: Check return value of wl_display_dispatch()
The simple clients all just call wl_display_dispatch() in a while loop
without checking the return value.  Now, if the server dies or other
error occurs, we get a -1 return value instead and need to break the loop.
2012-10-16 13:17:16 -04:00
John Kåre Alsaker 7a92ea494c util: Check result of weston_surface_animation_run. 2012-10-16 11:51:53 -04:00
John Kåre Alsaker 5e48a85e6b compositor-x11: Fix a memory leak. 2012-10-16 11:50:05 -04:00
John Kåre Alsaker e2e3d07beb compositor: Check if surface creation failed in weston_compositor_fade. 2012-10-16 11:39:09 -04:00