summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-07-15 09:47:22 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-07-15 09:47:22 +0300
commit46b730c6e41e13802e129a5e3970a66b6083311e (patch)
treeb78802c90f1c4804cb16b73d9cf11918135d30d9 /src/ui/widget.c
parent5ae68c54e3b56d79307a9dea88570347b16973dd (diff)
Widget: Removed unnecessary assertions
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 992f115d..4f567989 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -903,7 +903,7 @@ void unhover_Widget(void) {
903} 903}
904 904
905iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) { 905iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) {
906 iAssert(d->root == get_Root()); 906 //iAssert(d->root == get_Root());
907 if (!d->parent) { 907 if (!d->parent) {
908 if (get_Window()->focus && get_Window()->focus->root == d->root && isKeyboardEvent_(ev)) { 908 if (get_Window()->focus && get_Window()->focus->root == d->root && isKeyboardEvent_(ev)) {
909 /* Root dispatches keyboard events directly to the focused widget. */ 909 /* Root dispatches keyboard events directly to the focused widget. */
@@ -954,7 +954,7 @@ iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) {
954 handle the events first. */ 954 handle the events first. */
955 iReverseForEach(ObjectList, i, d->children) { 955 iReverseForEach(ObjectList, i, d->children) {
956 iWidget *child = as_Widget(i.object); 956 iWidget *child = as_Widget(i.object);
957 iAssert(child->root == d->root); 957 //iAssert(child->root == d->root);
958 if (child == get_Window()->focus && isKeyboardEvent_(ev)) { 958 if (child == get_Window()->focus && isKeyboardEvent_(ev)) {
959 continue; /* Already dispatched. */ 959 continue; /* Already dispatched. */
960 } 960 }
@@ -1000,11 +1000,11 @@ iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) {
1000 } 1000 }
1001 } 1001 }
1002 if (class_Widget(d)->processEvent(d, ev)) { 1002 if (class_Widget(d)->processEvent(d, ev)) {
1003 iAssert(get_Root() == d->root); 1003 //iAssert(get_Root() == d->root);
1004 return iTrue; 1004 return iTrue;
1005 } 1005 }
1006 } 1006 }
1007 iAssert(get_Root() == d->root); 1007 //iAssert(get_Root() == d->root);
1008 return iFalse; 1008 return iFalse;
1009} 1009}
1010 1010
@@ -1104,7 +1104,6 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) {
1104 setFlags_Widget(d, dragged_WidgetFlag, iFalse); 1104 setFlags_Widget(d, dragged_WidgetFlag, iFalse);
1105 } 1105 }
1106 if (d->commandHandler && d->commandHandler(d, ev->user.data1)) { 1106 if (d->commandHandler && d->commandHandler(d, ev->user.data1)) {
1107 iAssert(get_Root() == d->root);
1108 return iTrue; 1107 return iTrue;
1109 } 1108 }
1110 } 1109 }