summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 1ac4326a..9f67b1c7 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -2023,7 +2023,8 @@ iBool isAffectedByVisualOffset_Widget(const iWidget *d) {
2023} 2023}
2024 2024
2025void setFocus_Widget(iWidget *d) { 2025void setFocus_Widget(iWidget *d) {
2026 iWindow *win = get_Window(); 2026 iWindow *win = d ? window_Widget(d) : get_Window();
2027 iAssert(win);
2027 if (win->focus != d) { 2028 if (win->focus != d) {
2028 if (win->focus) { 2029 if (win->focus) {
2029 iAssert(!contains_PtrSet(win->focus->root->pendingDestruction, win->focus)); 2030 iAssert(!contains_PtrSet(win->focus->root->pendingDestruction, win->focus));
@@ -2038,6 +2039,13 @@ void setFocus_Widget(iWidget *d) {
2038 } 2039 }
2039} 2040}
2040 2041
2042void setKeyboardGrab_Widget(iWidget *d) {
2043 iWindow *win = d ? window_Widget(d) : get_Window();
2044 iAssert(win);
2045 win->focus = d;
2046 /* no notifications sent */
2047}
2048
2041iWidget *focus_Widget(void) { 2049iWidget *focus_Widget(void) {
2042 return get_Window()->focus; 2050 return get_Window()->focus;
2043} 2051}