static gboolean wnck_window_timeout_cb (WnckWindow *window) { const gchar *game; gint x, y; gint width, height; gchar *sql; GError *error = NULL; if (wnck_window_is_fullscreen (window)) goto exit; game = wnck_window_get_game (window); wnck_window_get_geometry (window, &x, &y, &width, &height); if (wnck_window_is_maximized (window)) sql = g_strdup_printf ( "UPDATE window SET maximized = 1 " "WHERE name = '%s'", game); else sql = g_strdup_printf ( "UPDATE window SET x = %d, y = %d, width = %d, " "height = %d, maximized = 0 WHERE name = '%s'", x, y, width, height, game); gva_db_execute (sql, &error); gva_error_handle (&error); g_free (sql); exit: g_object_set_data (G_OBJECT (window), TIMEOUT_SOURCE_ID_KEY, NULL); return FALSE; }
static int is_fullscreen_cb (WnckWindow *window, WnckWorkspace *workspace) { if (wnck_window_is_visible_on_workspace (window, workspace) && wnck_window_is_fullscreen (window)) { return 0; } else { return 1; } }
int c_get_window_fullscreen(lua_State *lua) { int top = lua_gettop(lua); if (top != 0) { luaL_error(lua, "is_fullscreen: %s", no_indata_expected_error); return 0; } gboolean result = FALSE; WnckWindow *window = get_current_window(); if (window) { result = wnck_window_is_fullscreen(window); } lua_pushboolean(lua, result); return 1; }