-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
All my programs show nothing on WIndows 11 (after connecting a second screen using an adapter) #8659
Comments
I found that this only happens when i connect a second screen to my laptop. The behavior is the same as described in the issue. The second screen is connected using a generic usb to hdmi/vga adapter, not sure if that matters. Disconnecting the screen "solves" the issue, but it is a shame that i can't work using my two screens, so my question still stands. How can i track or work around it? I still don't remember this happening before, but I'm not 100% sure, as i don't often work with two screens connected to my laptop. |
Can you try using a different backend ? Put |
I tried setting up the environment variable
And this is when the video adapter is not connected (the window is created successfully):
|
I found a workaround, which is terrible and annoying, but it does the trick. This is not a solution and, as a sidenote, the kivy programs also fail in the way i described above even if the main screen is mirrored, as long as the usb video adapter is connected. |
I still don't know the cause, but i now have determined when it happens. For some reason, if i set the display settings of my computer to internal, then i initialize a kivy widget (any widget, it does not matter), then i set display settings to extend again, i can create a kivy program after that even if the usb video adapter is connected. Whatever the problem is, it happens when the first widget is initialized, after that, creating a window is possible. However, the steps of showing in only one display, initializing a widget, then extending displays is not what i want. The code that shows what i describe is: import os
from kivy.uix.label import Label
os.system('DISPLAYSWITCH.exe /internal')
Label()
os.system('DISPLAYSWITCH.exe /extend')
import kivy
# kivy.require('2.1.0') # replace with your current kivy version !
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello world')
if __name__ == '__main__':
MyApp().run() Doing this before creating any kivy app window, i can successfully run my programs that i had before, but it is annoying watching my monitors flicker before running any kivy program. |
I have come to the conclusion that this problem is to niche. I found a "less annoying" solution. Whatever the problem is, it is related to the internal display and maybe the graphics card of my laptop. When I close the lid, the laptop's internal window doesn't appear in the display settings of windows, as if it were physically removed. That leaves me with the monitor i connect via hdmi, and the monitor connected with the video adapter. Here is when the problems i described above happen, as it is my working setup at home. Having the laptop lid open (even if i turn that screen off) just didn't make sense as my normal working conditions, but there you have it. THIS is the less annoying solution. Having the laptop lid slightly open, just so that windows detects the internal display, makes my kivy programs run normally (i suspect there is an internal switch, and windows not detecting the internal display of my laptop breaks all functionality with kivy apparently, unless i do the "fix" of my previous comment.) So, i'll just keep the lid of my laptop slightly open forever, or until someone finds any real solution. |
@SuperMechaDeathChrist , please keep an eye on #8665, and let us know if the issue persists even after the linked issue has been closed, so we can move forward with an investigation. |
Software Versions
Describe the bug
None of my programs are working. I have a lot of programs in my computer that i previously wrote and successfully ran using kivy, but none of them get to the point of opening the window to show it or starting the kivy main loop now.
This all happened overnight (i latter found out that this only happens when i use a second screen connected to an adapter), and it happens in two virtual environments created using anaconda. One is an old version kivy with an older python 3, and the other is the newest version of kivy (which worked during a few weeks) with a newer python 3. I can only asume something in a windows update or in my OS has broken compatibility with kivy, but i don't know how to search the bug as the logs show nothing. I can only track that after importing a few things in kivy, it just stops working and exits without doing anything or showing any errors.
Expected behavior
a normal log looks like this:
Now all my logs show nothing after
[INFO ] [Window ] Provider: sdl2
To Reproduce
The simplest kivy program doesn't work.
My exact Windows version is:
Edition: Windows 11 Home
Version: 22H2
Installed on: 05/01/2023
OS build: 22621.3296
Experience: Windows Feature Experience Pack 1000.22687.1000.0
Code and Logs and screenshots
Additional context
Any ideas regarding how to track or solve the problem are appreciated. I tried elevating the debug level to show as much as possible, but i can't find what is wrong. I'll try to use another window provider besides sdl2, as it seems to be the more likely suspect.
The text was updated successfully, but these errors were encountered: