remove no-longer-needed "topify_window" for Stat_Window, removed some lines that were commented out due to no longer being needed, etc. Seems to fix the windows randomly re-attaching in Win32.
This commit is contained in:
parent
cd858d6ade
commit
0186145065
|
@ -386,41 +386,12 @@ class Stat_Window:
|
||||||
font = pango.FontDescription("Sans 7")
|
font = pango.FontDescription("Sans 7")
|
||||||
self.label[r][c].modify_font(font)
|
self.label[r][c].modify_font(font)
|
||||||
|
|
||||||
# if not os.name == 'nt': # seems to be a bug in opacity on windows
|
|
||||||
self.window.set_opacity(parent.colors['hudopacity'])
|
self.window.set_opacity(parent.colors['hudopacity'])
|
||||||
|
|
||||||
# self.window.realize()
|
|
||||||
self.window.move(self.x, self.y)
|
self.window.move(self.x, self.y)
|
||||||
# self.window.show_all()
|
|
||||||
# set_keep_above(1) for windows
|
|
||||||
if os.name == 'nt': self.topify_window(self.window)
|
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
|
|
||||||
def topify_window(self, window):
|
|
||||||
"""Set the specified gtk window to stayontop in MS Windows."""
|
|
||||||
|
|
||||||
def windowEnumerationHandler(hwnd, resultList):
|
|
||||||
'''Callback for win32gui.EnumWindows() to generate list of window handles.'''
|
|
||||||
resultList.append((hwnd, win32gui.GetWindowText(hwnd)))
|
|
||||||
|
|
||||||
unique_name = 'unique name for finding this window'
|
|
||||||
real_name = window.get_title()
|
|
||||||
window.set_title(unique_name)
|
|
||||||
tl_windows = []
|
|
||||||
win32gui.EnumWindows(windowEnumerationHandler, tl_windows)
|
|
||||||
|
|
||||||
for w in tl_windows:
|
|
||||||
if w[1] == unique_name:
|
|
||||||
|
|
||||||
#win32gui.SetWindowPos(w[0], win32con.HWND_TOPMOST, 0, 0, 0, 0, win32con.SWP_NOMOVE|win32con.SWP_NOSIZE)
|
|
||||||
|
|
||||||
# style = win32gui.GetWindowLong(w[0], win32con.GWL_EXSTYLE)
|
|
||||||
# style |= win32con.WS_EX_TOOLWINDOW
|
|
||||||
# style &= ~win32con.WS_EX_APPWINDOW
|
|
||||||
# win32gui.SetWindowLong(w[0], win32con.GWL_EXSTYLE, style)
|
|
||||||
win32gui.ShowWindow(w[0], win32con.SW_SHOW)
|
|
||||||
window.set_title(real_name)
|
|
||||||
|
|
||||||
def destroy(*args): # call back for terminating the main eventloop
|
def destroy(*args): # call back for terminating the main eventloop
|
||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user