New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a window hint for setting app_id on wayland #2122
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -579,6 +579,9 @@ static GLFWbool createXdgSurface(_GLFWwindow* window) | |
&xdgToplevelListener, | ||
window); | ||
|
||
if (strlen(window->wl.appId)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the struct member is only set if the hint is a non-empty string, not setting the hint causes a segfault here. |
||
xdg_toplevel_set_app_id(window->wl.xdg.toplevel, window->wl.appId); | ||
|
||
if (window->wl.title) | ||
xdg_toplevel_set_title(window->wl.xdg.toplevel, window->wl.title); | ||
|
||
|
@@ -637,6 +640,8 @@ static GLFWbool createSurface(_GLFWwindow* window, | |
window->wl.height = wndconfig->height; | ||
window->wl.scale = 1; | ||
window->wl.title = _glfw_strdup(wndconfig->title); | ||
if (strlen(wndconfig->wl.appId)) | ||
window->wl.appId = _glfw_strdup(wndconfig->wl.appId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This allocation needs to be freed at window destruction. Alternatively, since the maximum length of the string is known, the struct member can be made a char array. |
||
|
||
window->wl.transparent = fbconfig->transparent; | ||
if (!window->wl.transparent) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably link to
GLFW_WAYLAND_APP_ID_hint
, like in the header file documentation snippet.