mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 01:33:16 +03:00
Avoid dealing with hlcache_handle in key handling.
This commit is contained in:
parent
ecd7cb8ca3
commit
d9e5f5f0a6
@ -1863,7 +1863,6 @@ bool ro_gui_window_toolbar_keypress(void *data, wimp_key *key)
|
|||||||
bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
|
bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
|
||||||
bool is_toolbar)
|
bool is_toolbar)
|
||||||
{
|
{
|
||||||
hlcache_handle *h;
|
|
||||||
struct contextual_content cont;
|
struct contextual_content cont;
|
||||||
os_error *ro_error;
|
os_error *ro_error;
|
||||||
wimp_pointer pointer;
|
wimp_pointer pointer;
|
||||||
@ -1888,9 +1887,6 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
|
|||||||
if (!ro_gui_window_to_window_pos(g, pointer.pos.x, pointer.pos.y, &pos))
|
if (!ro_gui_window_to_window_pos(g, pointer.pos.x, pointer.pos.y, &pos))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
h = g->bw->current_content;
|
|
||||||
|
|
||||||
browser_window_get_contextual_content(g->bw, pos.x, pos.y, &cont);
|
browser_window_get_contextual_content(g->bw, pos.x, pos.y, &cont);
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@ -1978,7 +1974,8 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case IS_WIMP_KEY + wimp_KEY_F8: /* View source */
|
case IS_WIMP_KEY + wimp_KEY_F8: /* View source */
|
||||||
ro_gui_view_source((cont.main != NULL) ? cont.main : h);
|
ro_gui_view_source((cont.main != NULL) ? cont.main :
|
||||||
|
browser_window_get_content(bw));
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case IS_WIMP_KEY + wimp_KEY_F9:
|
case IS_WIMP_KEY + wimp_KEY_F9:
|
||||||
@ -2029,7 +2026,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key,
|
|||||||
|
|
||||||
case 17: /* CTRL+Q (Zoom out) */
|
case 17: /* CTRL+Q (Zoom out) */
|
||||||
case 23: /* CTRL+W (Zoom in) */
|
case 23: /* CTRL+W (Zoom in) */
|
||||||
if (!h)
|
if (browser_window_has_content(bw) == false)
|
||||||
break;
|
break;
|
||||||
scale = g->scale;
|
scale = g->scale;
|
||||||
if (ro_gui_shift_pressed() && c == 17)
|
if (ro_gui_shift_pressed() && c == 17)
|
||||||
|
Loading…
Reference in New Issue
Block a user