-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Connected but window is invisible. #2444
Comments
I'm pretty sure this is unrelated, the window dimensions ( |
I get a window that is invisible, there is an icon in gnome-shell and I can move it to another workspace with hotkeys. Perhaps a difference between wayland and X? |
Hi, let me comment on this issue.... I'm on Fedora 38 (KDE) with Wayland and experiencing similar symptoms. Here's what gets printed in such session on the command line:
|
Hi, I'm on a similar setup like @plevart. I am using Fedora 38 (KDE) with Wayland and having the same issue. I tried the following as of now:
Please let me know if I can help gather any further info to debug this. P.S. as a workaround, I am using the flatpak for |
Currently, the window is created hidden with size 0x0: Lines 399 to 400 in c6ff78f
And resized+shown when the first frame is received: Line 470 in c6ff78f
Your problem could be probably reproduced with a minimal app doing the same with just SDL. If so, that will allow to report the problem to SDL. |
Wrote a minimal SDL app (used ChatGPT for this as I'm not an expert) The window seems to open up. Here is the code: #include <SDL.h>
#include <stdbool.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
SDL_Log("Unable to initialize SDL: %s", SDL_GetError());
return 1;
}
SDL_Window *window = SDL_CreateWindow("Test Window",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
0, 0,
SDL_WINDOW_HIDDEN);
if (!window) {
SDL_Log("Unable to create window: %s", SDL_GetError());
SDL_Quit();
return 1;
}
printf("Window created with size 0x0 and hidden\n");
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
if (!renderer) {
SDL_Log("Unable to create renderer: %s", SDL_GetError());
SDL_DestroyWindow(window);
SDL_Quit();
return 1;
}
bool running = true;
bool window_shown = false;
Uint32 start_time = SDL_GetTicks();
while (running) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
running = false;
}
}
Uint32 elapsed_time = SDL_GetTicks() - start_time;
if (!window_shown && elapsed_time >= 3000) {
SDL_SetWindowSize(window, 800, 600);
printf("Window resized to 800x600\n");
SDL_ShowWindow(window);
printf("Window shown\n");
window_shown = true;
}
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
}
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
} |
What if you set the position before the size (like scrcpy does)? Maybe there is a race condition, what if you don't wait 3 seconds before showing the window? Could add print logs to check the actual values passed to: Line 470 in c6ff78f
|
Environment
Describe the bug
Unable to get a display window from scrcpy without forcing a window size.
The command below works.
Please do not post screenshots of your terminal, just post the content as text instead.
The text was updated successfully, but these errors were encountered: