Commit Graph

2181 Commits

Author SHA1 Message Date
Kristian Høgsberg 4476aaff24 shell: Hide workspace layer when locking screen 2012-06-25 14:03:13 -04:00
Kristian Høgsberg 8fe8d24902 compositor: Send ping to keyboard focus surface for key press
We were sending to the pointer focus surface.
2012-06-22 16:57:21 -04:00
Kristian Høgsberg 22fbcf7183 terminal: Ignore more modifier keys
Don't want these to leak into the terminal.
2012-06-22 12:18:56 -04:00
Kristian Høgsberg b24ab806bf terminal: Only hide cursor for keypresses that generate data for the process 2012-06-22 12:18:20 -04:00
Daniel Stone a96b93c3bd compositor-drm: Add proper error handling to init
This way, if initialisation fails (say, udev or Mesa are broken, or we
couldn't find any devices), we'll at least take you back to where you
were, rather than leave you at a totally broken VT you can't escape
from.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:08 -04:00
Daniel Stone 725c2c3d68 Split weston_compositor_init into base and _gl
weston_compositor_init is always called late because most
implementations can't initialise GL until fairly late in the game.
Split it into a base version with the same name, followed by
weston_compositor_init_gl which can be called later on.

This simplifies compositor-wayland, which no longer needs a separate
global handler just for wl_seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:08 -04:00
Daniel Stone 5069280d29 compositor-wayland: Synchronise keyboard state with parent
Use the wl_keyboard::modifiers events our parent helpfully sends us to
make sure our views of the keyboard state are always identical, rather
than relying on key press events to do the right thing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:07 -04:00
Daniel Stone 154c34c851 compositor-x11: Attempt to track state without XKB
This isn't very pleasant, but it's pretty much the best we can do in the
absence of either XCB XKB support, or XCB XI2 bindings (argh!).

We get a state mask with most significant X11 events (which inexplicably
includes EnterNotify but not FocusIn), but unfortunately it's only a
single flat set of effective modifiers rather than the more granular
sets we want, so we still update the state with every key, but then also
use the core X11 state as a mask to make sure we don't get any stuck
modifiers.

Ugh.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:07 -04:00
Daniel Stone e2faa120ef compositor-x11: Use XKB StateNotify to synchronise state
Make sure that we always have the exact same view of the keyboard state
as the host server by using XKB StateNotify events to update our state
exactly rather than relying on key events.  In particular, this fixes
key state during grabs, where we either miss modifiers completely or get
them stuck permanently, depending on the nature of the grab and the
implementation of the X window manager/compositor.

The downside, however, is that Weston wakes up on every modifier change,
regardless of whether or not it has focus.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:07 -04:00
Daniel Stone 05d58682b3 Rename modifier_state_changed to notify_modifiers
notify_modifiers will now synchronise Weston's internal state with the
XKB state, and send a modifier event if necessary.  This eliminates the
need for update_modifier_state to have a return value at all.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:07 -04:00
Daniel Stone 1b4e11f38e notify_key: Add update_state argument
If update_state is true, then notify_key will continue to call
xkb_key_update_state to update the local state mask, as before this
commit.  Otherwise, it will rely on the compositor to manually update
the state itself, for nested compositors.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:07 -04:00
Daniel Stone 3ee91e1879 compositor-x11: Use XKB detectable autorepeat if possible
If we have XCB XKB support, use XKB's detectable autorepeat, which
generates repeat sequences as a series of
press-press-press-[...]-release events, rather than
press-release-press-release-[...].

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:07 -04:00
Daniel Stone 62b33b6964 compositor-x11: Add base XCB/XKB support
Try to find the XKB extension, to be used in later commits.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:06 -04:00
Daniel Stone 22815f9115 compositor-x11: Move input creation before output
So we can set up XKB masks and be sure to get the right events before
we set up our window.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:06 -04:00
Daniel Stone abb9dcdd1f weston_xkb_info: Cache all modifier indices for X11
X11 has a set of eight modifiers which we want to represent.  Cache
their indices when we create a weston_xkb_info, so we can use this from
compositor-x11 to keep the state synchronised exactly between the host X
server and a nested Weston instance.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:06 -04:00
Daniel Stone ef17267d38 Run key bindings on keyboard focus in
This is mainly for X11's benefit; the common case is using Logo+S to
take a screenshot, where GNOME Shell has grabbed Logo, and replays the
event down to the nested compositor after S is pressed.  This means we
get an enter event with both Logo and S down, and even if Shell delivers
the key press event for S (which isn't mandatory, and not all window
managers do), then we never run the binding since notify_key realises
that S is already down and exits early.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:06 -04:00
Daniel Stone c6587ea155 Ignore repeat keys in notify_key
Let compositors just blithely post through every event they get,
including repeating keys.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:05 -04:00
Daniel Stone 71c3877a40 Let wayland-server send modifier events for focus
When the focus changes, wl_keyboard_set_focus (and, as an added bonus,
wl_pointer_set_focus) will now send wl_keyboard::modifier events for us
if we store the modifier state in the right place, so we don't have to
worry about that anymore.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:05 -04:00
Daniel Stone d6da09e935 Split notify_keyboard_focus into in/out variants
Since the two functions had nothing in common but the local variables.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:05 -04:00
Daniel Stone 9c7df91b19 .gitignore: Ignore ctags and cscope output
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:52:04 -04:00
Kristian Høgsberg 11f600d82e window.c: Always set cursor after pointer enter
If the cursor didn't change since last time we had pointer focus we just
wouldn't change it.  But whoever had pointer focus in the mean time could
have changed it, so make sure we always set the cursor after pointer enter.
2012-06-22 10:52:58 -04:00
Kristian Høgsberg 1ce6a2a2b3 shell: Animate input panel mapping
We slide it in from below.
2012-06-21 22:34:39 -04:00
Kristian Høgsberg 414bd420fd util: Generalize surface animation code
Too much duplicated code here, and we're about to introduce another
animation.
2012-06-21 22:07:30 -04:00
Kristian Høgsberg 85b2e4b6bf shell: Don't focus to background, screensaver or input_panel surfaces 2012-06-21 16:49:42 -04:00
Kristian Høgsberg a4a4de487e shell: Don't allow move/resize/rotate for input panel surfaces 2012-06-21 16:46:14 -04:00
Jan Arne Petersen cba9e470ba text: Add example clients for text protocol 2012-06-21 16:41:12 -04:00
Jan Arne Petersen 1f17be442e text: Add input_method and text_model interfaces 2012-06-21 16:41:09 -04:00
Jan Arne Petersen 42feced8de shell: Add support for input panels 2012-06-21 16:41:06 -04:00
Juan Zhao 8634f51b63 tablet-shell client:fix one seg-fault error
When the icon provided in weston.ini is not available, it will report a segfault error.
Check the icon at first.
backtrace:
*INT_cairo_surface_status (surface=0x0) at cairo-surface.c:259
259     {
(gdb) bt
 #0  *INT_cairo_surface_status (surface=0x0) at cairo-surface.c:259
 #1  0x0804baca in tablet_shell_add_launcher (data=0xbfb800ec)
     at tablet-shell.c:404
 #2  launcher_section_done (data=0xbfb800ec) at tablet-shell.c:434
 #3  0x08051121 in parse_config_file (
     path=0x8b96c10 "/root/.config/weston.ini", sections=0x8053c80,
     num_sections=2, data=0xbfb800ec) at config-parser.c:113
 #4  0x0804c0f9 in main (argc=1, argv=0xbfb801d4) at tablet-shell.c:480

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-06-21 16:11:10 -04:00
Kristian Høgsberg 88fd40815a terminal: Only hide cursor on first key-press in a repeat sequence
Otherwise moving the pointer while holding a key down will flicker.
2012-06-21 15:55:03 -04:00
Kristian Høgsberg d813445f16 shell: Just use surface->private for shell_surface 2012-06-21 12:49:02 -04:00
Kristian Høgsberg ae9e073ac5 terminal: Support both Alt and Control modifiers for regular keys 2012-06-21 12:32:23 -04:00
Kristian Høgsberg b7f94bff3d terminal: Handle Alt-Backspace 2012-06-21 12:32:23 -04:00
Kristian Høgsberg 6c6fb993f7 shell: Schedule repaint when moving a surface
It seems we used to rely on the repaint scheduled by the cursor motion.
But if there's no cursor, there's no cursor motion, so we need to schedule
our own repaint.
2012-06-21 12:32:23 -04:00
Kristian Høgsberg 63b298f3c7 terminal: Set blank cursor on keyboard press
This way we can better see the contents of the terminal.  Show cursor again
on pointer motion.
2012-06-20 23:04:58 -04:00
Kristian Høgsberg f337052a5c window: Add support for the blank cursor 2012-06-20 23:04:41 -04:00
Kristian Høgsberg f2735ea8af compositor-drm: Hide hw cursor if cursor sprite isn't mapped 2012-06-20 23:03:53 -04:00
Kristian Høgsberg b21fb9f61e terminal: Add Ctrl-Shift-N keyboard binding to open new window 2012-06-20 22:44:03 -04:00
Kristian Høgsberg d3c69c279a window: Stop keyboard repeat when we lose keyboard focus 2012-06-20 22:41:59 -04:00
Kristian Høgsberg de845cfcc0 terminal: Default terminal type to xterm
We add an option to configure the terminal type so it's still possible to
get xterm-256color.
2012-06-20 22:14:35 -04:00
Kristian Høgsberg 8b19c64146 window: Create timerfd non-blocking
Otherwise we might end up blocking when we reset the timer after the
timerfd poll readable.
2012-06-20 18:00:13 -04:00
Kristian Høgsberg 71a4cf4374 terminal: Send ASCII DEL on for backspace 2012-06-20 17:57:56 -04:00
Kristian Høgsberg a1627927c7 window: Compute initial window size correctly
We didn't take decoration size into account before.
2012-06-20 17:30:03 -04:00
Kristian Høgsberg e828e904b5 terminal: Track down remaining unhandled xterm-256color escape codes 2012-06-20 16:59:17 -04:00
Kristian Høgsberg cca3c2f9da terminal: Fix tab expansion 2012-06-20 15:56:13 -04:00
Kristian Høgsberg 82cd36bfff terminal: Make terminal font configurable from command line and weston.ini 2012-06-20 15:29:07 -04:00
Kristian Høgsberg bd0cd762bc window: Only repeat key if we still have kb focus 2012-06-20 15:17:18 -04:00
Kristian Høgsberg cf4d244082 window: Add key-repeat to toy toolkit 2012-06-20 14:52:12 -04:00
Kristian Høgsberg 3033425a49 compositor: Fix missing ';' in previous commit 2012-06-20 14:24:21 -04:00
Martin Minarik 37032f831f compositor: Verify XDG_RUNTIME_DIR variable
Print an user friendly error mesage when
the variable is not a valid directory.

krh: Edited to make message a litle more precise and added a check to
verify XDG_RUNTIME_DIR ownership and access mode.
2012-06-20 13:42:50 -04:00