Skip to content

Commit 7f3de64

Browse files
ReillyBroganLibretroAdmin
authored andcommitted
wayland: Fix Wayland appId
1 parent 0e9ea9f commit 7f3de64

9 files changed

Lines changed: 21 additions & 12 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ install: $(TARGET)
240240
cp tools/cg2glsl.py $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
241241
cp retroarch.cfg $(DESTDIR)$(GLOBAL_CONFIG_DIR)
242242
cp com.libretro.RetroArch.appdata.xml $(DESTDIR)$(DATA_DIR)/metainfo
243-
cp retroarch.desktop $(DESTDIR)$(DATA_DIR)/applications
243+
cp org.libretro.RetroArch.desktop $(DESTDIR)$(DATA_DIR)/applications
244244
cp docs/retroarch.6 $(DESTDIR)$(MAN_DIR)/man6
245245
cp docs/retroarch-cg2glsl.6 $(DESTDIR)$(MAN_DIR)/man6
246246
cp media/retroarch.svg $(DESTDIR)$(DATA_DIR)/pixmaps
@@ -249,7 +249,7 @@ install: $(TARGET)
249249
chmod 755 $(DESTDIR)$(BIN_DIR)/$(TARGET)
250250
chmod 755 $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
251251
chmod 644 $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
252-
chmod 644 $(DESTDIR)$(DATA_DIR)/applications/retroarch.desktop
252+
chmod 644 $(DESTDIR)$(DATA_DIR)/applications/org.libretro.RetroArch.desktop
253253
chmod 644 $(DESTDIR)$(DATA_DIR)/metainfo/com.libretro.RetroArch.appdata.xml
254254
chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch.6
255255
chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch-cg2glsl.6
@@ -274,7 +274,7 @@ uninstall:
274274
rm -f $(DESTDIR)$(BIN_DIR)/$(TARGET)
275275
rm -f $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
276276
rm -f $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
277-
rm -f $(DESTDIR)$(DATA_DIR)/applications/retroarch.desktop
277+
rm -f $(DESTDIR)$(DATA_DIR)/applications/org.libretro.RetroArch.desktop
278278
rm -f $(DESTDIR)$(DATA_DIR)/metainfo/com.libretro.RetroArch.appdata.xml
279279
rm -f $(DESTDIR)$(DATA_DIR)/pixmaps/retroarch.svg
280280
rm -f $(DESTDIR)$(DOC_DIR)/COPYING

Makefile.lfx000

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ install: $(TARGET)
214214
cp tools/cg2glsl.py $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
215215
cp retroarch.cfg $(DESTDIR)$(GLOBAL_CONFIG_DIR)
216216
cp com.libretro.RetroArch.appdata.xml $(DESTDIR)$(DATA_DIR)/metainfo
217-
cp retroarch.desktop $(DESTDIR)$(DATA_DIR)/applications
217+
cp org.libretro.RetroArch.desktop $(DESTDIR)$(DATA_DIR)/applications
218218
cp docs/retroarch.6 $(DESTDIR)$(MAN_DIR)/man6
219219
cp docs/retroarch-cg2glsl.6 $(DESTDIR)$(MAN_DIR)/man6
220220
cp media/retroarch.svg $(DESTDIR)$(DATA_DIR)/pixmaps
@@ -223,7 +223,7 @@ install: $(TARGET)
223223
chmod 755 $(DESTDIR)$(BIN_DIR)/$(TARGET)
224224
chmod 755 $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
225225
chmod 644 $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
226-
chmod 644 $(DESTDIR)$(DATA_DIR)/applications/retroarch.desktop
226+
chmod 644 $(DESTDIR)$(DATA_DIR)/applications/org.libretro.RetroArch.desktop
227227
chmod 644 $(DESTDIR)$(DATA_DIR)/metainfo/com.libretro.RetroArch.appdata.xml
228228
chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch.6
229229
chmod 644 $(DESTDIR)$(MAN_DIR)/man6/retroarch-cg2glsl.6

com.libretro.RetroArch.appdata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- Copyright 2019 Rob Loach <[email protected]> -->
33
<component type="desktop-application">
44
<id>com.libretro.RetroArch</id>
5-
<launchable type="desktop-id">retroarch.desktop</launchable>
5+
<launchable type="desktop-id">org.libretro.RetroArch.desktop</launchable>
66
<name>RetroArch</name>
77
<summary>Frontend for emulators, game engines and media players</summary>
88
<developer_name>libretro</developer_name>

gfx/common/wayland_common.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
#define SPLASH_SHM_NAME "retroarch-wayland-vk-splash"
3636

37-
#define APP_ID "org.libretro.RetroArch"
3837
#define WINDOW_TITLE "RetroArch"
3938

4039
#ifdef HAVE_LIBDECOR_H
@@ -727,7 +726,7 @@ bool gfx_ctx_wl_init_common(
727726
goto error;
728727
}
729728

730-
wl->libdecor_frame_set_app_id(wl->libdecor_frame, APP_ID);
729+
wl->libdecor_frame_set_app_id(wl->libdecor_frame, WAYLAND_APP_ID);
731730
wl->libdecor_frame_set_title(wl->libdecor_frame, WINDOW_TITLE);
732731
wl->libdecor_frame_map(wl->libdecor_frame);
733732

@@ -753,7 +752,7 @@ bool gfx_ctx_wl_init_common(
753752
wl->xdg_toplevel = xdg_surface_get_toplevel(wl->xdg_surface);
754753
xdg_toplevel_add_listener(wl->xdg_toplevel, &toplevel_listener->xdg_toplevel_listener, wl);
755754

756-
xdg_toplevel_set_app_id(wl->xdg_toplevel, APP_ID);
755+
xdg_toplevel_set_app_id(wl->xdg_toplevel, WAYLAND_APP_ID);
757756
xdg_toplevel_set_title(wl->xdg_toplevel, WINDOW_TITLE);
758757

759758
if (wl->deco_manager)

gfx/common/wayland_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#define SPLASH_WINDOW_WIDTH 240
2626
#define SPLASH_WINDOW_HEIGHT 256
2727

28+
#define WAYLAND_APP_ID "org.libretro.RetroArch"
29+
2830
typedef struct toplevel_listener
2931
{
3032
#ifdef HAVE_LIBDECOR_H

input/common/wayland_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ typedef struct gfx_ctx_wayland_data
170170
struct libdecor *libdecor_context;
171171
struct libdecor_frame *libdecor_frame;
172172
#ifdef HAVE_DYLIB
173-
struct dylib_t *libdecor;
173+
dylib_t libdecor;
174174
#define RA_WAYLAND_SYM(rc,fn,params) rc (*fn) params;
175175
#include "../../gfx/common/wayland/libdecor_sym.h"
176176
#endif

pkg/sailfishos/retroarch-sailfishos.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ sed -i \
6363

6464
sed -i \
6565
's|^Exec=retroarch|Exec=retroarch --menu|' \
66-
%{buildroot}/usr/share/applications/retroarch.desktop
66+
%{buildroot}/usr/share/applications/org.libretro.RetroArch.desktop
6767

6868
# Install icon file in the correct place
6969
mkdir -p %{buildroot}/usr/share/icons/hicolor/86x86/apps
@@ -75,7 +75,7 @@ sed -i \
7575
%doc README.md
7676
%config /etc/retroarch.cfg
7777
%{_prefix}/bin/retroarch
78-
%{_prefix}/share/applications/retroarch.desktop
78+
%{_prefix}/share/applications/org.libretro.RetroArch.desktop
7979
%{_prefix}/share/man/man6/*.6*
8080
%{_prefix}/share/icons/hicolor/86x86/apps/retroarch.*
8181
%{_prefix}/share/doc/retroarch/*

ui/drivers/ui_qt.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ extern "C" {
9191
#include "../../version_git.h"
9292
#endif
9393

94+
#ifdef HAVE_WAYLAND
95+
#include "../../gfx/common/wayland_common.h"
96+
#endif
97+
9498
#ifndef CXX_BUILD
9599
}
96100
#endif
@@ -4230,6 +4234,10 @@ static void* ui_application_qt_initialize(void)
42304234

42314235
#ifdef Q_OS_UNIX
42324236
setlocale(LC_NUMERIC, "C");
4237+
#ifdef HAVE_WAYLAND
4238+
// This needs to match the name of the .desktop file in order for windows to be correctly associated on Wayland
4239+
ui_application.app->setDesktopFileName(WAYLAND_APP_ID);
4240+
#endif
42334241
#endif
42344242
{
42354243
/* Can't declare the pixmap at the top, because: "QPixmap: Must construct a QGuiApplication before a QPixmap" */

0 commit comments

Comments
 (0)