Commit Graph

394 Commits

Author SHA1 Message Date
Kristian Høgsberg
dd631c1c36 simple-touch: Update to enter/leave changes 2012-02-23 16:20:38 -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
Kristian Høgsberg
66c0880c58 view: Don't schedule resize after setting fullscreen
window_set_fullscreen will schedule a resize or wait for the configure
event as needed.
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
Ander Conselvan de Oliveira
e47c3a342b clients/dnd: adapt to new data_device icon protocol
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.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
Kristian Høgsberg
d6bcd7daa7 window: Toggle maximized with super-f5 2012-02-16 23:19:38 -05:00
Tiago Vignatti
0a26641626 clients: fix spelling
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-13 11:52:24 +02:00
Tiago Vignatti
c5528d8dc8 window: simplify a bit widget_set_size and widget_set_allocation
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-13 11:52:24 +02:00
Tiago Vignatti
a571e75cc1 window: explicitly set TYPE_TOPLEVEL for new windows
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-13 11:52:24 +02:00
Kristian Høgsberg
0212723185 smoke: Use normal window resize mechanism 2012-02-08 14:47:53 -05:00
Kristian Høgsberg
09a96b5394 window: Don't set the window size in widget_set_size()
We propagate the toplevel widget size to the window size in the
window.c resize code.
2012-02-08 14:45:02 -05:00
Juan Zhao
6665063328 smoke: fix the segment fault error
Add widget_set_size in the initiate time to allow smoke get the
correct surface later. Or it will report segment fault error because
of the null surface.

Also add resize_handler to not allow resizing just like flower.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-02-08 14:17:32 -05:00
Kristian Høgsberg
3d5437c48d Add support for webp image format 2012-02-08 12:46:57 -05:00
Kristian Høgsberg
902865c757 cairo-util: Only look at first two bytes for jpegs
The next two bytes aren't fixed.
2012-02-08 10:11:42 -05:00
Peter Hutterer
035ac94c17 terminal: run $SHELL if set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-07 16:26:11 -05:00
Kristian Høgsberg
2ad3b7f866 window: Fold window_resize into idle_resize 2012-01-31 15:34:15 -05:00
Kristian Høgsberg
0d1c062913 window: Don't overwrite window->allocation until we've done the resize
This way we can actually detect whether or not a window resizes.
2012-01-31 15:30:47 -05:00
Kristian Høgsberg
009ac0a965 window: Dont take width and height in window constructor
Always set this by scheduling an initial resize.
2012-01-31 15:24:48 -05:00
Kristian Høgsberg
8e054f76cc flower: Dont allow resizing 2012-01-31 11:53:20 -05:00
Kristian Høgsberg
c25a1d73fc flower: Redraw flower on middle click, pop up window menu on right click 2012-01-31 09:54:04 -05:00
Kristian Høgsberg
d31fcab989 window: Make window frame menu available to client 2012-01-31 09:53:44 -05:00
Scott Moreau
fa1de69203 Implement CONFIG_KEY_UNSIGNED_INTEGER
strtol() does not work when trying to assign 32 bits of data into a
regular signed int on 32 bit systems. Use corresponding strtoul()
instead.
2012-01-27 15:34:27 -05:00
Kristian Høgsberg
b7674a2a6c Merge remote-tracking branch 'pq/transform-v1' 2012-01-27 11:42:18 -05:00
Pekka Paalanen
a291ae55b0 desktop-shell: print what failed on exec
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 11:33:07 -05:00
Ander Conselvan de Oliveira
e018b04c40 window: fix resizing of windows backed by shm buffers
When window_attach_surface() calls window_get_resize_dx_dy(),
window->resize_edges is cleared. However if there is already a pending
surface to be attached, the resize won't be done until the following
call to window_attach_surface(). In this next call, since resize_edges
is now zero, the top-left corner of the window will be unchanged. If
the user is resizing from the top or left border, this causes the
resize to happen in the wrong direction.

This patch changes window_attach_surface() to call
window_get_resize_dx_dy() only if an attach will actually happen.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-01-27 11:17:13 -05:00
Kristian Høgsberg
42c8f60506 window: Handle data_device.selection events with offer=NULL
This happens when the current selection data_offer is removed.
2012-01-27 11:08:40 -05:00
Pekka Paalanen
b13e84f4e9 clickdot: implement the purpose
Remove all unneeded resizor features, and add the feature why clickdot
exists: put a visible marker to exactly where mouse was clicked.

This app can be used to check input coordinate transformations in a
compositor.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 10:44:22 +02:00
Pekka Paalanen
6920190013 clickdot: a copy of resizor
Start a new application clickdot as a copy of resizor, with the name
changed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 10:44:22 +02:00
Pekka Paalanen
1ef94c8742 update git ignores
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 10:44:22 +02:00
Kristian Høgsberg
804e05185b cairo-util: Don't anger png.h by including setjmp.h
Older libpngs are a bit fussy about this, apparently.
2012-01-26 11:36:17 -05:00
Kristian Høgsberg
ae6e2717c5 window: Don't crash when window with focus_widget is destroyed
We would try to deliver a leave event to a widget in a destroyed window.
2012-01-26 11:09:20 -05:00
Kristian Høgsberg
6af8eb9c7f desktop-shell: Build in sensible defaults
This adds a default background pattern and a terminal launcher in case
we don't have a config file.
2012-01-25 20:53:08 -05:00
Kristian Høgsberg
07f729441e desktop-shell: Support tiling of background images 2012-01-25 16:34:36 -05:00
Kristian Høgsberg
d654876510 cairo-util: Add png loader and image type sniffing 2012-01-25 16:30:48 -05:00
Kristian Høgsberg
8129bc0fb9 desktop-shell: Fall back to solid color if there's no background image 2012-01-25 14:55:33 -05:00
Kristian Høgsberg
ffe3bba13e cairo-util: Return NULL instead of exit() on jpeg load failure 2012-01-25 14:54:26 -05:00
Kristian Høgsberg
a97eca95d0 Install terminal as weston-terminal 2012-01-25 14:02:05 -05:00
Neil Roberts
6b28aadd47 window: Fix sending button events when there's no grab
The code which sends the button events was checking whether there is a
focus widget with a button handler but then always sending the button
event to the grab widget. If the grab widget is different from the
focus widget at this point then it will check the wrong widget for a
button handler and potentially crash. It is also possible for there to
be no grab widget here in the following situation:

1. Press and hold down the left mouse button
2. Press and hold down the right mouse button
3. Release the left mouse button
4. Release the right mouse button

In this case the grab will be released at step 3 because the code only
keeps track of the grab for one button. Then it will try to send the
release event for the right mouse button to a NULL widget so it will
crash.
2012-01-24 11:25:15 -05:00
Kristian Høgsberg
5f5324e098 gears: Make window transparent
We need this for the window decorations.
2012-01-19 14:05:21 -05:00
Kristian Høgsberg
824c6d0e38 window: Use CAIRO_OPERATOR_OVER for rendering the menu
We forgot to switch back from CAIRO_OPERATOR_SOURCE, which is broken,
but also hits a broken fallback in cairo-gl.
2012-01-19 13:54:11 -05:00
Pekka Paalanen
9e30a82e25 desktop-shell: don't crash on menu
Add dummy menu callback function, so we don't crash after every time
someone opens the menu.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 10:19:01 -05:00
Pekka Paalanen
6d174cff7a window: menu leak fixes
When a menu self-destructs, free also the widget and struct menu.

As menus are self-destructing, it does not make sense to store the
window pointer, since we cannot clear it automatically. Therefore,
rename window_create_menu() to window_show_menu() that does not return
the window pointer. It also calls window_schedule_redraw() internally.

Fixes Valgrind reported memory leaks.

The alternative would be to explicitly destroy the menu in application's
menu callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:42:05 +02:00
Pekka Paalanen
84d62dc999 resizor: free the widget on destroy
Plugs a memory leak.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:41:59 +02:00
Pekka Paalanen
e156fb681e window: remove pointers to widget on destroy
Input devices may hold a pointer to the widget being destroyed. Reset
such pointers in widget_destroy().

This fixes a use-after-free in window_destroy(), if an application
destroys its widgets before the window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-19 16:41:55 +02:00