[Bug] Custom Titlebar window focus problems
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comience ejecutando la reproducción de Python proporcionada en Linux y compare el comportamiento con y sin use_custom_titlebar. Rastree el manejo del foco de la ventana de la barra de título personalizada utilizado por el punto de entrada Window y, a continuación, verifique que mover el puntero sobre la ventana principal no le dé el foco mientras la ventana secundaria se superpone a ella. Vuelva a ejecutar el ejemplo proporcionado para confirmar el comportamiento de foco esperado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Type of Issue (Enhancement, Error, Bug, Question)
Bug
Environment
Operating System
Linux version ('glibc', '2.35')
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
Python version (sg.sys.version)
3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
PySimpleGUI Version (sg.__version__)
5.0.4.15
GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)
8.6.12
Your Experience In Months or Years (optional)
Years Python programming experience
Years Programming experience overall
No Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
- Searched main docs for your problem https://Docs.PySimpleGUI.com
- Looked for Demo Programs that are similar to your goal.
It is recommend you use the Demo Browser! https://Demos.PySimpleGUI.com - If not tkinter - looked for Demo Programs for specific port
- For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
- None of your GUI code was generated by an AI algorithm like GPT
- Run your program outside of your debugger (from a command line)
- Searched through Issues (open and closed) to see if already reported https://Issues.PySimpleGUI.com
- Have upgraded to the latest release of PySimpleGUI on PyPI (latest official version) https://Upgrading.PySimpleGUI.com
- Tried running the Maintenance Release. Use Home Window to access Maint Releases
- For licensing questions please email mailto:license@PySimpleGUI.com
Detailed Description
When multiple windows are open and overlapping, moving the mouse to the parent window sends child to the back. I have 2 windows, the first has a button to call the second window. If the second window overlaps the parent window in any way, moving the mouse into the parent window immediately gives focus to that, hiding the overlapping portion of window 2. It should require a mouse click in the parent window before giving it focus.
If I comment out the 'use custom titlebar' option it works correctly but I then have borders around the window, so things like the button bar, status bar are indented on both sides, looking pretty ordinary. I have tried defining the titlebar separately & not setting the option within the window call but the result is the same.
Code To Duplicate
import PySimpleGUI as sg
def main_window():
winsize = (800, 600)
toolbar_buttons = [[sg.Button('Test', key='-TEST-')]]
layout = [[sg.Frame('', toolbar_buttons, title_color='white', size=(winsize[0], 30),
pad=(0,0), background_color=sg.COLOR_SYSTEM_DEFAULT)]]
win1 = sg.Window('test', size=winsize,
use_custom_titlebar=True,
layout=layout)
while True:
event, values = win1.read()
print('main event= ', event)
if event == '-TEST-':
second_window()
if event in (sg.WIN_CLOSED, '-CANCEL', 'CANCELB', '-EXIT-'):
break
win1.close()
def second_window():
winsize = (600, 400)
layout = [[sg.Text('Input',pad=(5, 0))],
[sg.Input()]
]
win2 = sg.Window('test', layout=layout, size=winsize,
keep_on_top=True, use_custom_titlebar=True)
while True:
event, values = win2.read()
if event in (sg.WIN_CLOSED, '-CANCEL', 'CANCELB', '-EXIT-'):
break
win2.close()
if __name__ == '__main__':
main_window()
Screenshot, Sketch, or Drawing
- Lenguaje dominante
- Python
- Estrellas
- 13.8k
- Forks
- 1.8k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PySimpleGUI/PySimpleGUI
-
Bug Done - Install Dev Build (see docs for how) Platform Specific Issue - Linux Port - TK
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PySimpleGUI/PySimpleGUI#6904 · 15 comentarios ·
-
Bug Demo Programs Done - Install Dev Build (see docs for how) Interoperability Port - TK workaround available
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PySimpleGUI/PySimpleGUI#6900 · 1 comentario ·
-
Done - Install Dev Build (see docs for how) enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
PySimpleGUI/PySimpleGUI#3251 · 12 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
PySimpleGUI/PySimpleGUI#6906 · 1 comentario · 1 reacción ·
-
Bug Done - Install Dev Build (see docs for how) Port - TK
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
PySimpleGUI/PySimpleGUI#6902 · 1 comentario ·
Todos los issues de PySimpleGUI/PySimpleGUI
Issues similares
-
essnmx good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
[Feature] 奇物选择添加优先级 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
syfoud/Simulated_Scepter#174 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Giskard-AI/giskard-oss#2840 · 1 comentario ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Abiertoarea: repo bug perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yeti-platform/yeti#1380 ·