summaryrefslogtreecommitdiff
path: root/src/osk_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r--src/osk_gui.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp
index 681762e08..f92bb16b0 100644
--- a/src/osk_gui.cpp
+++ b/src/osk_gui.cpp
@@ -157,11 +157,7 @@ static void OskWndProc(Window *w, WindowEvent *e)
if (qs->orig == NULL || strcmp(qs->text.buf, qs->orig) != 0) {
/* pass information by simulating a button press on parent window */
if (WP(w, osk_d).ok_btn != 0) {
- Window *parent = w->parent;
- WindowEvent e;
- e.event = WE_CLICK;
- e.we.click.widget = WP(w, osk_d).ok_btn;
- parent->HandleWindowEvent(&e);
+ w->parent->OnClick(e->we.click.pt, WP(w, osk_d).ok_btn);
}
}
delete w;
@@ -169,11 +165,7 @@ static void OskWndProc(Window *w, WindowEvent *e)
case OSK_WIDGET_CANCEL:
if (WP(w, osk_d).cancel_btn != 0) { // pass a cancel event to the parent window
- Window *parent = w->parent;
- WindowEvent e;
- e.event = WE_CLICK;
- e.we.click.widget = WP(w, osk_d).cancel_btn;
- parent->HandleWindowEvent(&e);
+ w->parent->OnClick(e->we.click.pt, WP(w, osk_d).cancel_btn);
} else { // or reset to original string
strcpy(qs->text.buf, WP(w, osk_d).orig);
UpdateTextBufferSize(&qs->text);