; Module/File: Window_SetPresent.pb ; Function: Deiconify Window, set it to current desktop, top it and give the focus - Linux gtk2/gtk3 ; Author: Omi ; Date: Mar. 29, 2015 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ;behaviour depends on window manager EnableExplicit ImportC "" gtk_widget_get_window(*widget.GtkWidget) EndImport ; Object constants #MainWin = 0 Global.i gEvent, gQuit Procedure Window_SetUntop(Window); only for demo gdk_window_lower_(gtk_widget_get_window(WindowID(Window))) EndProcedure OpenWindow(#MainWin, 100, 100, 170, 160, "gtk_window present", #PB_Window_ScreenCentered) Window_SetUntop(#MainWin); first untop gtk_window_iconify_(WindowID(#MainWin)); then iconify for demo AddWindowTimer(#MainWin, 0, 2000) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Timer If EventTimer()= 0 ; **** gtk_window_present_(WindowID(#MainWin)); here it is in front ; **** RemoveWindowTimer(#MainWin, 0) EndIf EndSelect Until gQuit ; IDE Options = PureBasic 5.40 LTS (Linux - x86) ; CursorPosition = 18 ; Folding = - ; EnableUnicode ; EnableXP