# HG changeset patch # User ib # Date 1301573034 0 # Node ID 8c96263e0f0969d4fb98ea2498ab9788f7dfb327 # Parent 8b561660a6f714d0172c38d0a290e49f4142e130 Clean up cmd_window(). Assign currWinName only after it has been checked. Compare window name in full. Add currWinItemIdx and currWinItems assignments for sub windows. diff -r 8b561660a6f7 -r 8c96263e0f09 gui/skin/skin.c --- a/gui/skin/skin.c Thu Mar 31 11:38:30 2011 +0000 +++ b/gui/skin/skin.c Thu Mar 31 12:03:54 2011 +0000 @@ -179,19 +179,21 @@ return 1; } - av_strlcpy(currWinName, strlower(in), sizeof(currWinName)); + strlower(in); - if (!strncmp(in, "main", 4)) { + if (strcmp(in, "main") == 0) { currWin = &appMPlayer.main; currWinItemIdx = &appMPlayer.IndexOfMainItems; currWinItems = appMPlayer.mainItems; - } else if (!strncmp(in, "sub", 3)) + } else if (strcmp(in, "sub") == 0) { currWin = &appMPlayer.sub; - else if (!strncmp(in, "playbar", 7)) { + currWinItemIdx = NULL; + currWinItems = NULL; + } else if (strcmp(in, "playbar") == 0) { currWin = &appMPlayer.bar; currWinItemIdx = &appMPlayer.IndexOfBarItems; currWinItems = appMPlayer.barItems; - } else if (!strncmp(in, "menu", 4)) { + } else if (strcmp(in, "menu") == 0) { currWin = &appMPlayer.menuBase; currWinItemIdx = &appMPlayer.IndexOfMenuItems; currWinItems = appMPlayer.menuItems; @@ -200,6 +202,8 @@ return 1; } + av_strlcpy(currWinName, in, sizeof(currWinName)); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] window: %s\n", currWinName); return 0;