提交 957c2664 编写于 作者: N night_xiaoye

window icon: set window icon on taskbar to data/ui/logo.png

In UOS system, windows of all kinds of apps have icon that not odds with app name.
So We Use unified icon: logo.png, so that this problem will be solved.
Note: UOS finds Desktop fast links to determine icon of program's window, so set fast links to
anbox-launch.sh is important. And then, anbox-launch.sh will transparent inputs to anbox-session
process.
上级 1426fea5
......@@ -152,6 +152,8 @@ if (SNAP_CONFINEMENT)
endif()
install(FILES data/ui/loading-screen.png DESTINATION ${ANBOX_RESOURCE_DIR}/ui)
install(FILES data/ui/kpandroid.png DESTINATION ${ANBOX_RESOURCE_DIR}/ui)
install(PROGRAMS scripts/anbox-launch.sh DESTINATION ${CMAKE_INSTALL_BINDIR})
# uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
......
#!/bin/bash
anbox launch $*
......@@ -74,7 +74,7 @@ void LauncherStorage::add_or_update(const Database::Item &item) {
if (utils::get_env_value("SNAP").length() > 0)
exe_path = snap_exe_path;
std::string exec = utils::string_format("%s launch ", exe_path);
std::string exec = utils::string_format("%s-launch.sh ", exe_path);
if (!item.launch_intent.action.empty())
exec += utils::string_format("--action=%s ", item.launch_intent.action);
......
......@@ -19,6 +19,7 @@
#include "anbox/wm/window_state.h"
#include "anbox/graphics/density.h"
#include "anbox/logger.h"
#include "anbox/system_configuration.h"
#include <boost/throw_exception.hpp>
#include <SDL2/SDL_image.h>
......@@ -77,6 +78,11 @@ Window::Window(const std::shared_ptr<Renderer> &renderer,
if (SDL_SetWindowHitTest(window_, &Window::on_window_hit, this) < 0)
BOOST_THROW_EXCEPTION(std::runtime_error("Failed to register for window hit test"));
std::string strPath = SystemConfiguration::instance().resource_dir() + "/ui/kpandroid.png";
SDL_Surface *icon = IMG_Load(strPath.c_str());
SDL_SetWindowIcon(window_, icon);
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
SDL_GetWindowWMInfo(window_, &info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册