Skip to content

Commit

Permalink
2007-09-20 Ross Burton <[email protected]>
Browse files Browse the repository at this point in the history
	* src/matchbox-keyboard.h:
	* src/matchbox-keyboard-remote.c:
	Change mb_kbd_remote_process_xevents to return
	MBKeyboardRemoteOperation instead of performing the operation.
	Also Declare mb_kbd_ui_limit_orientation.

	* src/matchbox-keyboard-ui.c:
	Action the operation reutrned returned by process_xevents, and if
	we receive a Hide command wait for 100ms before hiding the
	keyboard, so that if we immediately receive a Show the keyboard
	doesn't flicker.

	Based on a patch by Daniel Willmann <[email protected]>.


git-svn-id: https://svn.o-hand.com/repos/matchbox/trunk/matchbox-keyboard@1687 b067294f-1dea-0310-9683-c47a78595994
  • Loading branch information
ross committed Sep 20, 2007
1 parent 1ec67e8 commit 59787a3
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 8 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2007-09-20 Ross Burton <[email protected]>

* src/matchbox-keyboard.h:
* src/matchbox-keyboard-remote.c:
Change mb_kbd_remote_process_xevents to return
MBKeyboardRemoteOperation instead of performing the operation.
Also Declare mb_kbd_ui_limit_orientation.

* src/matchbox-keyboard-ui.c:
Action the operation reutrned returned by process_xevents, and if
we receive a Hide command wait for 100ms before hiding the
keyboard, so that if we immediately receive a Show the keyboard
doesn't flicker.

Based on a patch by Daniel Willmann <[email protected]>.

2007-09-17 Matthew Allum <[email protected]>

* src/matchbox-keyboard-key.c:
Expand Down
9 changes: 5 additions & 4 deletions src/matchbox-keyboard-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mb_kbd_remote_init (MBKeyboardUI *ui)
"_MB_IM_INVOKER_COMMAND", False);
}

void
MBKeyboardRemoteOperation
mb_kbd_remote_process_xevents (MBKeyboardUI *ui, XEvent *xevent)
{
DBG("got a message\n");
Expand All @@ -39,12 +39,13 @@ mb_kbd_remote_process_xevents (MBKeyboardUI *ui, XEvent *xevent)
DBG("is a Client Message\n");
if (xevent->xclient.message_type == Atom_MB_IM_INVOKER_COMMAND)
{
DBG("got a message of type _MB_IM_INVOKER_COMMAND, val %i\n",
DBG("got a message of type _MB_IM_INVOKER_COMMAND, val %lu\n",
xevent->xclient.data.l[0]);
if (xevent->xclient.data.l[0] == 1)
mb_kbd_ui_show (ui);
return MBKeyboardRemoteShow;
else
mb_kbd_ui_hide (ui);
return MBKeyboardRemoteHide;
}
}
return MBKeyboardRemoteNone;
}
39 changes: 36 additions & 3 deletions src/matchbox-keyboard-ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ mb_kbd_ui_event_loop(MBKeyboardUI *ui)
/* Key repeat - values for standard xorg install ( xset q) */
int repeat_delay = 100 * 10000;
int repeat_rate = 30 * 1000;
int hide_delay = 100 * 1000;
int to_hide = 0;

int press_x = 0, press_y = 0;

Expand Down Expand Up @@ -1182,11 +1184,42 @@ mb_kbd_ui_event_loop(MBKeyboardUI *ui)
mb_kbd_xembed_process_xevents (ui, &xev);

if (ui->is_daemon)
mb_kbd_remote_process_xevents (ui, &xev);

}
{
switch (mb_kbd_remote_process_xevents (ui, &xev))
{
case MBKeyboardRemoteHide:
if (to_hide == 1) {
mb_kbd_ui_hide(ui);
}
tvt.tv_usec = hide_delay;
to_hide = 1;
break;
case MBKeyboardRemoteShow:
mb_kbd_ui_show(ui);
tvt.tv_usec = repeat_delay;
to_hide = 0;
break;
case MBKeyboardRemoteNone:
if (to_hide == 1) {
mb_kbd_ui_hide(ui);
tvt.tv_usec = repeat_delay;
to_hide = 0;
}
break;
}
}
}
else
{
/* Hide timed out */
if (to_hide)
{
DBG("Hide timed out, calling mb_kbd_ui_hide");
mb_kbd_ui_hide(ui);
tvt.tv_usec = repeat_delay;
to_hide = 0;
}

/* Keyrepeat */
if (mb_kbd_get_held_key(ui->kbd) != NULL)
{
Expand Down
14 changes: 13 additions & 1 deletion src/matchbox-keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ typedef enum
}
MBKeyboardDisplayOrientation;

typedef enum
{
MBKeyboardRemoteShow,
MBKeyboardRemoteHide,
MBKeyboardRemoteNone,
}
MBKeyboardRemoteOperation;

struct MBKeyboard
{
MBKeyboardUI *ui;
Expand Down Expand Up @@ -179,6 +187,10 @@ struct MBKeyboardUIBackend
int
mb_kbd_ui_init(MBKeyboard *kbd);

void
mb_kbd_ui_limit_orientation (MBKeyboardUI *ui,
MBKeyboardDisplayOrientation orientation);

int
mb_kbd_ui_realize(MBKeyboardUI *ui);

Expand Down Expand Up @@ -285,7 +297,7 @@ mb_kbd_xembed_process_xevents (MBKeyboardUI *ui, XEvent *xevent);
void
mb_kbd_remote_init (MBKeyboardUI *ui);

void
MBKeyboardRemoteOperation
mb_kbd_remote_process_xevents (MBKeyboardUI *ui, XEvent *xevent);

/**** Keyboard ****/
Expand Down

0 comments on commit 59787a3

Please sign in to comment.