; Module/File: Desktop_GetWindowManager2.pb ; Function: Get the name of the window manager with x11 - Linux gtk2/gtk3 ; Author: Omi ; Date: Aug. 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 ;-------------------------------------------------------------- EnableExplicit ImportC "" gdk_window_get_screen(*Window) gtk_widget_get_window(*widget.GtkWidget) EndImport ; Object constants #Win_Main = 0 #Txt1 = 0 Global.i gEvent, gEventWin, gQuit Procedure.i GetGdkWindow(Window) ProcedureReturn gtk_widget_get_window(WindowID(Window)) EndProcedure Procedure GetWindowScreen(Window) ProcedureReturn gdk_window_get_screen(GetGdkWindow(Window)) EndProcedure Procedure Create_WinMain() If OpenWindow(#Win_Main, 300, 200, 300, 100, "Get window manager", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#Txt1, 5, 5, 290, 22, "") SetGadgetText(#Txt1, "Window manager: " + PeekS(gdk_x11_screen_get_window_manager_name_(GetWindowScreen(#Win_Main)), -1, #PB_UTF8)) EndIf EndProcedure Create_WinMain() Repeat gEvent= WaitWindowEvent() gEventWin= EventWindow() If gEventWin = #Win_Main Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget EndSelect EndIf Until gQuit ; IDE Options = PureBasic 5.40 LTS Beta 9 (Linux - x86) ; CursorPosition = 15 ; Folding = - ; EnableUnicode ; EnableXP