mirror of
https://github.com/labwc/labwc.git
synced 2026-03-28 07:58:28 -04:00
view.c: next_toplevel(): handle NULL pointer
This commit is contained in:
parent
cb9cb384e4
commit
49d2e029aa
2 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,6 @@ static bool handle_keybinding(struct server *server, xkb_keysym_t sym)
|
||||||
case XKB_KEY_F1:
|
case XKB_KEY_F1:
|
||||||
case XKB_KEY_F2:
|
case XKB_KEY_F2:
|
||||||
server->cycle_view = next_toplevel(view_front_toplevel(server));
|
server->cycle_view = next_toplevel(view_front_toplevel(server));
|
||||||
fprintf(stderr, "cycle_view=%p\n", (void *)server->cycle_view);
|
|
||||||
break;
|
break;
|
||||||
case XKB_KEY_F3:
|
case XKB_KEY_F3:
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,8 @@ struct view *view_front_toplevel(struct server *server)
|
||||||
|
|
||||||
struct view *next_toplevel(struct view *current)
|
struct view *next_toplevel(struct view *current)
|
||||||
{
|
{
|
||||||
/* FIXME: write nr_toplevels() */
|
if (!current)
|
||||||
|
return NULL;
|
||||||
struct view *view = current;
|
struct view *view = current;
|
||||||
do {
|
do {
|
||||||
view = wl_container_of(view->link.next, view, link);
|
view = wl_container_of(view->link.next, view, link);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue