summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-08-17 08:52:35 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-08-17 08:52:35 +0000
commit89fe05d03a60e24fb72914ccdb214ba890a251a8 (patch)
tree22fcb46c510a0df3355d1c31f3babdc893ae4b80 /legacy
parent4c78dfadae84fcc5cf94fa2938847305c88c4c98 (diff)
Ecore_Wayland: Add some trapping to make sure we have a valid window
before trying to read a window id. SVN revision: 75374
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c
index cf9b086f3b..4f7760b72b 100644
--- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c
@@ -963,8 +963,11 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
963 ev->multi.x = input->sx; 963 ev->multi.x = input->sx;
964 ev->multi.y = input->sy; 964 ev->multi.y = input->sy;
965 965
966 ev->window = win->id; 966 if (win)
967 ev->event_window = win->id; 967 {
968 ev->window = win->id;
969 ev->event_window = win->id;
970 }
968 971
969 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL); 972 ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
970} 973}
@@ -985,8 +988,11 @@ _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
985 ev->modifiers = input->modifiers; 988 ev->modifiers = input->modifiers;
986 ev->timestamp = timestamp; 989 ev->timestamp = timestamp;
987 990
988 ev->window = win->id; 991 if (win)
989 ev->event_window = win->id; 992 {
993 ev->window = win->id;
994 ev->event_window = win->id;
995 }
990 996
991 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL); 997 ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL);
992} 998}
@@ -1007,8 +1013,11 @@ _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsi
1007 ev->modifiers = input->modifiers; 1013 ev->modifiers = input->modifiers;
1008 ev->timestamp = timestamp; 1014 ev->timestamp = timestamp;
1009 1015
1010 ev->window = win->id; 1016 if (win)
1011 ev->event_window = win->id; 1017 {
1018 ev->window = win->id;
1019 ev->event_window = win->id;
1020 }
1012 1021
1013 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL); 1022 ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL);
1014} 1023}
@@ -1022,7 +1031,7 @@ _ecore_wl_input_focus_in_send(Ecore_Wl_Input *input __UNUSED__, Ecore_Wl_Window
1022 1031
1023 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_In)))) return; 1032 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_In)))) return;
1024 ev->timestamp = timestamp; 1033 ev->timestamp = timestamp;
1025 ev->win = win->id; 1034 if (win) ev->win = win->id;
1026 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL); 1035 ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL);
1027} 1036}
1028 1037
@@ -1035,7 +1044,7 @@ _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input __UNUSED__, Ecore_Wl_Window
1035 1044
1036 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_Out)))) return; 1045 if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_Out)))) return;
1037 ev->timestamp = timestamp; 1046 ev->timestamp = timestamp;
1038 ev->win = win->id; 1047 if (win) ev->win = win->id;
1039 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL); 1048 ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL);
1040} 1049}
1041 1050
@@ -1078,8 +1087,11 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
1078 ev->multi.x = input->sx; 1087 ev->multi.x = input->sx;
1079 ev->multi.y = input->sy; 1088 ev->multi.y = input->sy;
1080 1089
1081 ev->window = win->id; 1090 if (win)
1082 ev->event_window = win->id; 1091 {
1092 ev->window = win->id;
1093 ev->event_window = win->id;
1094 }
1083 1095
1084 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL); 1096 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
1085} 1097}
@@ -1122,8 +1134,11 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
1122 ev->multi.x = input->sx; 1134 ev->multi.x = input->sx;
1123 ev->multi.y = input->sy; 1135 ev->multi.y = input->sy;
1124 1136
1125 ev->window = win->id; 1137 if (win)
1126 ev->event_window = win->id; 1138 {
1139 ev->window = win->id;
1140 ev->event_window = win->id;
1141 }
1127 1142
1128 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL); 1143 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
1129} 1144}