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]
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
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]
It is recommend you use the Demo Browser! https://Demos.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
Screenshot, Sketch, or Drawing