Fix duplicate Ctrl+V (and other shortcuts) key processing,

by catching event callback return value.
This commit is contained in:
Ole Loots 2013-04-09 00:40:21 +02:00
parent d64416774d
commit 3fa929938b
3 changed files with 12 additions and 3 deletions

View File

@ -605,7 +605,7 @@ short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]
}
if (handler_called==false) {
dest->handler_func(dest, ev_out, msg);
retval = dest->handler_func(dest, ev_out, msg);
}
}
}

View File

@ -142,7 +142,7 @@ void gui_poll(bool active)
aes_event_in.emi_m1.g_x = mx;
aes_event_in.emi_m1.g_y = my;
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
if(!gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out)) {
if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
LOG(("WM: %d\n", aes_msg_out[0]));
switch(aes_msg_out[0]) {

View File

@ -174,6 +174,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
uint16_t nkc = gem_to_norm( (short)ev_out->emo_kmeta,
(short)ev_out->emo_kreturn);
retval = on_window_key_input(data->rootwin, nkc);
// printf("on_window_key_input: %d\n", retval);
}
if ((ev_out->emo_events & MU_BUTTON) != 0) {
@ -745,7 +746,7 @@ void window_redraw_favicon(ROOTWIN *rootwin, GRECT *clip)
objc_draw(tree, 0, 8, clip->g_x, clip->g_y, clip->g_w, clip->g_h);
} else {
// TODO: consider the clipping rectangle
printf("window_redraw_favicon image %p\n", rootwin->icon);
//printf("window_redraw_favicon image %p\n", rootwin->icon);
struct rect work_clip = { 0,0,work.g_w,work.g_h };
int xoff=0;
if (work.g_w > work.g_h) {
@ -1256,37 +1257,45 @@ static bool on_content_keypress(struct browser_window *bw, unsigned short nkc)
case KEY_LINE_START:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, -(g.g_w/slid->x_unit_px),
false);
r = true;
break;
case KEY_LINE_END:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, (g.g_w/slid->x_unit_px),
false);
r = true;
break;
case KEY_PAGE_UP:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, (g.g_h/slid->y_unit_px),
false);
r = true;
break;
case KEY_PAGE_DOWN:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, (g.g_h/slid->y_unit_px),
false);
r = true;
break;
case KEY_RIGHT:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, -1, false);
r = true;
break;
case KEY_LEFT:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, 1, false);
r = true;
break;
case KEY_UP:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, -1, false);
r = true;
break;
case KEY_DOWN:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, 1, false);
r = true;
break;
default: