Commit Graph

249 Commits

Author SHA1 Message Date
Dima Ryazanov
ff1c2d7914 window: Don't crash if a cursor image failed to load.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
2012-05-09 11:25:11 -04:00
Rafal Mielniczuk
87e4c9354e window: fix check of cursor image load result 2012-05-08 16:22:31 -04:00
Kristian Høgsberg
7016313778 Port Wayland clients to new xkbcommon API
A little different from Daniels initial patch.  We look up the common
modifiers at xkb init time and convert the xkb serialized modifier mask
to our own modifier bitmask.
2012-05-08 15:55:39 -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
Daniel Stone
b230a7ee58 Convert internal input co-ordinates to GLfloat
Change all client motion handlers to take GLfloat for co-ordinates,
rather than int32_t.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:40:57 -04:00
Ander Conselvan de Oliveira
001de54ea1 window: use only one shm pool for all the cursor images
Cursor images are fairly small and having one pool for each image adds
a lot of unnecessary overhead. Instead, create one large pool and
allocated all cursor images from that.

In order to do that, however, the code that creates shm surface needed
some refactoring. This patch adds a new struct shm_pool that is used
by the cursor and also changes struct window to use it.
2012-05-07 14:44:02 -04:00
Daniel Stone
5d66371743 Change button from int to uint32_t
Since you can't really have a negative button number.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 12:57:11 -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
Ander Conselvan de Oliveira
1493d2ae1c window: use libXcursor for loading pointer images 2012-05-03 10:14:04 -04:00
Kristian Høgsberg
3e0fe5c0df window: Set window title and class 2012-05-02 09:47:55 -04:00
Kristian Høgsberg
407ef64e17 window: Only set toplevel window type if nothing else is set 2012-04-27 17:17:12 -04:00
Casey Dahlin
9074db5d62 Send surface enter/leave events
These new protocol events allow us to tell which outputs a surface is on, and
potentially update where we allocate our buffers from.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
2012-04-20 13:39:40 -04:00
Scott Moreau
ff1db4a4f3 Install structuring for ping-pong protocol 2012-04-19 12:50:47 -04:00
Kristian Høgsberg
a6c8b0084f window.c: Drop the toolkit grab when we start a compositor grab
We do this right for move and resize, but dnd and popups need the same
treatment.
2012-04-13 12:55:45 -04:00
Kristian Høgsberg
f2eb68a921 window: Send serial number in set_popup request 2012-04-13 12:37:19 -04:00
Kristian Høgsberg
84b76c72c8 window: Initialize redraw_task.link so we can always remove it 2012-04-13 12:01:18 -04:00
Kristian Høgsberg
eae5de7609 Follow wayland change to serial numbers 2012-04-11 22:42:15 -04:00
Kristian Høgsberg
5990fbb6e2 window: Fix remaining references to the egl image surface type
Didn't catch these before, was compiling with sw cairo.
2012-04-10 16:55:11 -04:00
Kristian Høgsberg
bad4297380 window: Drop EGLImage surface type 2012-04-10 11:49:45 -04:00
Kristian Høgsberg
24b5e230fa window: Only unmap shm surface backing memory if it belongs to surface
Memory allocated out of the resize shm pool will be unmapped when the pool
is destroyed.
2012-04-10 11:32:35 -04:00
Kristian Høgsberg
6e2a8d74b5 window: Simplify the shm surface management
We can destroy a shm wl_buffer immediately after sending it to the server.
2012-04-10 11:23:13 -04:00
Kristian Høgsberg
610a3f2922 window: Check load_image result for NULL 2012-04-03 14:50:15 -04:00
Jonas Ådahl
3685c3abf6 Fix `unused-result' warnings.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-04-03 14:50:15 -04:00
Kristian Høgsberg
1103a1a484 window: Use a persistent, big shm pool during resize
The biggest performance bottleneck while resizing is the continous
setting up and tearing down of mmaps and faulting in pages.  This commit
introduces a per-window pool that we'll allocate buffers out of if it's
available.  Then we set initialize it to a big shm pool when we start
resizing and free it when resizing is done.
2012-04-03 12:00:48 -04:00
Kristian Høgsberg
8f64ed0381 window: Only initialize egl if we have cairo egl 2012-04-03 11:57:44 -04:00
Kristian Høgsberg
16626282fd clients: Use new shm interface 2012-04-03 11:22:06 -04:00
Kristian Høgsberg
875ab9e735 Add signedness warning flag and fix fallout 2012-03-30 11:52:39 -04:00
Kristian Høgsberg
9629fe3206 Simplify shm buffer handling
There was a lot of code here to do a lot of work we didn't need to do.
If we damage a surface with a shm buffer attached, all we need to do
is to re-upload the damaged region to the texture.  As for drm buffers,
we don't assume anything changes on attach and only update the
regions the client tells us to update in the damage request.
2012-03-26 19:27:35 -04:00
Kristian Høgsberg
42b4f80116 window.c: Do resize work from the repaint idle callback
This way we always make sure we handle any resizing before we start drawing.
2012-03-26 13:49:29 -04:00
Kristian Høgsberg
6bd4d97271 window.c; Only redraw once per frame
Based on a patch from Martin Minarik <minarik11@student.fiit.stuba.sk> who
tracked down the excessive redraw problem.
2012-03-24 14:42:09 -04:00
Scott Moreau
210d079817 Hook up axis events. 2012-03-22 11:03:41 -06:00
Kristian Høgsberg
ec323d222c window.c: Increase drop shadow fluffiness 2012-03-21 01:07:49 -04:00
Kristian Høgsberg
b8abe7e9ae window.c: Tweak window decoration appearance
The old orange decorations were starting to look like clown shoes.
2012-03-20 23:56:05 -04:00
Kristian Høgsberg
f02a649a3c Consolidate image loading code and move to shared/ 2012-03-12 01:40:59 -04:00
Kristian Høgsberg
bcacef19b0 Add an option parser
On one hand, getopt (in particular the -o suboption syntax) sucks on the
server side, and on the client side we would like to avoid the glib
dependency.  We can roll out own option parser and solve both problems
and save a few lines of code total.
2012-03-12 01:28:50 -04:00
Rob Clark
6396ed36f4 clients/window: fix build issues w/ gles 2012-03-12 01:16:12 -04:00
Kristian Høgsberg
b435e84d5a window: Compute frame boundary for all windows except fullscreen
We were only computing it for toplevel type windows, which broke
the unlock dialog size allocation and repainting.
2012-03-05 20:38:08 -05:00
Kristian Høgsberg
63e5e06d82 window: Only set opaque and input regions if they change
Setting these regions damages the entire window or causes a repick, which
we don't want to trigger if we don't need to.
2012-03-05 00:04:57 -05:00
Kristian Høgsberg
067fd60534 window.c: Drop support for rgb contexts 2012-02-29 16:15:53 -05:00
Kristian Høgsberg
f10df85cd7 window: Set opaque region after child widget adjusts size 2012-02-29 12:43:05 -05:00
Kristian Høgsberg
fcfc83f6ae clients: Use wl_display_disconnect() 2012-02-28 14:34:54 -05:00
Kristian Høgsberg
010f98b083 window: Track and report input and opaque regions
We just set the input region to the bounding box of the window frame
and set the opaque region to be the opaque rectangle inside the window
if the child widget is opaque.
2012-02-23 17:30:54 -05:00
Kristian Høgsberg
06d58b74af Update to enter/leave events for pointer and keyboard 2012-02-23 09:59:05 -05:00
Kristian Høgsberg
2675dc1c8d window: Don't draw decorations in fullscreen mode 2012-02-16 23:19:41 -05:00
Kristian Høgsberg
1517defe13 window: Set window type as it changes, not on every attach
It was always a bit sloppy, and the new fullscreen request doesn't work
that way.
2012-02-16 23:19:41 -05:00
Daniel Stone
0d5a509ae5 window: Use constant keycode offset of 8
The X11 compositor currently posts its key presses as keycode - 8; this
is due to X11 having a historical minimum keycode of 8, whereas evdev is
numbered starting from 1.  So while the KEY_* constants begin with
KEY_ESC at 1, the corresponding keycode in both X11 and the XKB keymaps
is 9.

window, on the other hand, was relying on xkb->min_key_code being 8 to
translate its keycodes back to useful values in the XKB 'evdev' keycode
map.  min_key_code may not always be 8, for restricted subsets of the
keycode map.

Perhaps not the best solution, but at least consistent.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-16 23:19:41 -05:00
Daniel Stone
9d4f030c0b window: Use new xkbcommon include path
xkbcommon in current git has moved its include files.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-02-16 23:19:40 -05:00
Pekka Paalanen
b29f412eb8 protocol: remove absolute coordinates from pointer
This change depens on the Wayland core commit:
"protocol: remove absolute coordinates from pointer".

Remove the absolute coordinates from pointer motion and pointer_focus
events.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-16 23:19:40 -05:00
Pekka Paalanen
dfb93a9e71 window: do not store absolute coordinates
These were not used for anything, anyway.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-16 23:19:40 -05:00
Kristian Høgsberg
f856fd2f93 Follow set_fullscreen protocol change 2012-02-16 23:19:38 -05:00