summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-11-14 12:44:10 +0000
committerChris Michael <cp.michael@samsung.com>2013-11-14 12:44:10 +0000
commite8aa7087eb9c9684508cb6e9bd50ec08b6950d3c (patch)
treecdd774fe4e8b3670729f730637628750fc73fa95 /src
parentc5a83c5b9e7bd13a3389ad8bb937b830783e5bde (diff)
Check for valid shell_surface, title, and class before trying to set
them else wayland segfaults (internal wayland code does no safety checks). Also, Fix some formatting while I am here... Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index a1225d0f11..e9ecd795e4 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -265,8 +265,12 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
265 win->shell_surface = 265 win->shell_surface =
266 wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, 266 wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
267 win->surface); 267 win->surface);
268 wl_shell_surface_set_title(win->shell_surface, win->title); 268 if (!win->shell_surface) return;
269 wl_shell_surface_set_class(win->shell_surface, win->class_name); 269
270 if (win->title)
271 wl_shell_surface_set_title(win->shell_surface, win->title);
272 if (win->class_name)
273 wl_shell_surface_set_class(win->shell_surface, win->class_name);
270 } 274 }
271 275
272 if (win->shell_surface) 276 if (win->shell_surface)
@@ -707,7 +711,7 @@ ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title)
707 if (!win) return; 711 if (!win) return;
708 eina_stringshare_replace(&win->title, title); 712 eina_stringshare_replace(&win->title, title);
709 713
710 if (win->shell_surface) 714 if ((win->shell_surface) && (win->title))
711 wl_shell_surface_set_title(win->shell_surface, win->title); 715 wl_shell_surface_set_title(win->shell_surface, win->title);
712} 716}
713 717
@@ -720,7 +724,7 @@ ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name)
720 if (!win) return; 724 if (!win) return;
721 eina_stringshare_replace(&win->class_name, class_name); 725 eina_stringshare_replace(&win->class_name, class_name);
722 726
723 if (win->shell_surface) 727 if ((win->shell_surface) && (win->class_name))
724 wl_shell_surface_set_class(win->shell_surface, win->class_name); 728 wl_shell_surface_set_class(win->shell_surface, win->class_name);
725} 729}
726 730