You are not logged in.

#1 2014-07-17 16:32:07

yackeroeni
Member
Registered: 2014-07-17
Posts: 3

Full screen games (from Steam) in XMonad invisible

Hi,

I've been trying to get games to work on my new setup and have problems running games in fullscreen mode.

I have a dual monitor setup (one 720p and one 1080p monitor) and am running XMonad (config file included below).
I have installed steam and it works fine. Launching games is no problem as long as they are in windowed mode. For example, launching dota 2 with the '-windowed' flag works fine.
However, when trying to launch a game in fullscreen mode (Dustforce/Super Meat Boy/Dota 2 in fullscreen) the game becomes invisible. I can hear the sound of the game, but am unable to see it or, as far as I know, interact with it.
Some games work totally fine in full screen. For example Knytt Underground has no problem working fullscreen as long as I disable my other monitor. And unity games (tested with '140') work fine as well, even in full screen mode.

I have tried using the XMonad.Layout.Fullscreen layout, but it had no effect.
Trying to float the windows based on class or title using a ManageHook works for applications such as VLC media player, but not for these games.
I have tried the isFullScreen -?> doFullFloat thing, but it didn't work either.
Finally I tried launching the games with a new X server, which didn't work because it couldn't find the necessary game libraries and the windows wouldn't actually go fullscreen as there was no windowmanager to resize them.

Does anyone else have this problem or a similar one?
I have really exhausted all my resources and don't know what to do next.

If you need more information (screencaps, ...), I'm happy to supply it.


My xmonad.hs:

-- Custom configuration for xmonad

-- Imports
import XMonad
import XMonad.Actions.Navigation2D
import XMonad.Actions.Submap
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Util.EZConfig
import XMonad.Util.Loggers

import qualified XMonad.StackSet as W

import qualified Data.Map as M

import System.IO

-- Variables
myMod			= mod1Mask -- alt
myTerminal		= "urxvt"
myBrowser		= "chromium"
myLauncher		= "gmrun"
myLayouts		= tiled ||| Mirror tiled ||| noBorders Full
	where
		-- tiled is Tall
		tiled	= ResizableTall nmaster delta ratio []
		-- default number of panes in master
		nmaster	= 1
		-- default proportion of screen occupied by master pane
		ratio	= 1/2
		-- increase in size on resize
		delta	= 3/100

mySBCommand		= "dzen2 "++flags
	where
		width	= "710"
		xpos	= "1360"
		font	= "xft:Deja Vu Sans:style=book:size=11:antialias=true"
		fg		= "#aaaaaa"
		bg		= "#000000"
		flags	= "-e 'onstart=lower' -ta l -w "++width++" -x "++xpos++" -fn '"++font++"' -fg '"++fg++"' -bg '"++bg++"'"

myPP			= defaultPP {
	ppCurrent		= dzenColor "#ffffff" "#000000" . wrap "|" "|"
	,ppVisible		= dzenColor "#ffffff" "#000000" 
	,ppOrder		= \(ws:_:t:_) -> [ws,t]
}

myManageHook		= composeAll
	[ 	manageDocks
	,	fullscreenManageHook
	]
myHandleEventHook	= composeAll
	[	docksEventHook 
	,	fullscreenEventHook
	]

audioDevice1		= "alsa_output.usb-2516_Sirus_Headset-00-Headset.analog-surround-51"
audioDevice2		= "alsa_output.pci-0000_00_1b.0.analog-surround-51"

-- Status bar setup
myStatusBar		= statusBar mySBCommand myPP toggleStrutsKey

-- Main function
main = do
	spawn "~/.dzen/clock.sh"
	spawn "~/.dzen/info.sh"
	xmonad =<< myStatusBar myConfig

-- Main configuration
myConfig = defaultConfig {
	modMask				= myMod
	,terminal			= myTerminal
	,layoutHook			= myLayouts
	,manageHook			= myManageHook
	,handleEventHook	= myHandleEventHook
} `removeKeys`
	[	(myMod,						xK_l)
	,	(myMod,						xK_k)
	,	(myMod,						xK_j)
	,	(myMod,						xK_h)
	,	(myMod .|. shiftMask,		xK_l)
	,	(myMod .|. shiftMask,		xK_k)
	,	(myMod .|. shiftMask,		xK_j)
	,	(myMod .|. shiftMask,		xK_h)
	,	(myMod,						xK_comma)
	,	(myMod,						xK_period)
	,	(myMod,						xK_Tab)
	]	
  `additionalKeys`
	[-- move between windows	
		((myMod,					xK_l),		windowGo R False)
	,	((myMod,					xK_k),		windowGo U False)
	,	((myMod,					xK_j),		windowGo D False)
	,	((myMod,					xK_h),		windowGo L False)
	
	-- resize windows
	,	((myMod .|. shiftMask,		xK_l),		dynamicExpand)
	,	((myMod .|. shiftMask,		xK_k),		dynamicMirrorExpand)
	,	((myMod .|. shiftMask,		xK_j),		dynamicMirrorShrink)
	,	((myMod .|. shiftMask,		xK_h),		dynamicShrink)

	-- swap windows
	,	((myMod ,		xK_Escape),			submap . M.fromList $
		[	((myMod,	xK_l),		windowSwap R False)
		,	((myMod,	xK_k),		windowSwap U False)
		,	((myMod,	xK_j),		windowSwap D False)
		,	((myMod,	xK_h),		windowSwap L False)
		])

	-- add/remove from master pane
	,	((myMod .|. shiftMask,		xK_comma),	sendMessage $ IncMasterN 1)
	,	((myMod .|. shiftMask,		xK_period),	sendMessage $ IncMasterN (-1))

	-- navigate across screens (tab + direction)
	,	((myMod,					xK_Tab),	submap . M.fromList $
			[	((0,				xK_l),		screenGo R False)
			,	((0,				xK_k),		screenGo U False)
			,	((0,				xK_j),		screenGo D False)
			,	((0,				xK_h),		screenGo L False)
	-- swap workspaces between screens (tab + (control + direction))
			,	((controlMask,		xK_l),		screenSwap R False)
			,	((controlMask,		xK_k),		screenSwap U False)
			,	((controlMask,		xK_j),		screenSwap D False)
			,	((controlMask,		xK_h),		screenSwap L False)
	-- send windows between screens (tab + (shift + direction))
			,	((shiftMask,		xK_l),		windowToScreen R False)
			,	((shiftMask,		xK_k),		windowToScreen U False)
			,	((shiftMask,		xK_j),		windowToScreen D False)
			,	((shiftMask,		xK_h),		windowToScreen L False)
			])
	-- cycle through windows
	,	((myMod,					xK_g),		windows W.focusDown)

	
	-- launch launcher
	,	((0,						xK_Super_L),	spawn myLauncher)
	,	((0,						xK_Super_R),	spawn myLauncher)
	-- launch browser
	,	((myMod .|. shiftMask,		xK_semicolon),	spawn myBrowser)
	-- ctrl alt del shuts down, ctrl alt ins restarts
	,	((myMod .|. controlMask,	xK_Delete),	shutdownCommand)
	,	((myMod .|. controlMask,	xK_Insert),	restartCommand)

	-- switch sound outputs (using G keys)
	,	((myMod .|. shiftMask .|. controlMask,		xK_F1),		spawn $ ssoCommand audioDevice1)
	,	((myMod .|. shiftMask .|. controlMask,		xK_F2),		spawn $ ssoCommand audioDevice2)

	-- media keys
	,	((0,	0x1008FF11),	audioLowerVolume)
	,	((0,	0x1008FF12),	audioMute)
	,	((0,	0x1008FF13),	audioRaiseVolume)
	,	((0,	0x1008FF14),	audioPlay)
	,	((0,	0x1008FF15),	audioStop)
	,	((0,	0x1008FF16),	audioPrev)
	,	((0,	0x1008FF17),	audioNext)
 	]	
-- toggle statusbar
toggleStrutsKey	XConfig{modMask = modm} = (modm, xK_b)

-- Commands to shut down/restart pc
shutdownCommand = spawn "sudo shutdown -h now"
restartCommand = spawn "sudo shutdown -r now"

-- Functions to make dynamic expanding and shrinking across multiple layouts possible
currentLayoutName = dynamicLogString defaultPP { ppOrder= \(_:l:_:_) -> [l] }

dynamicExpand = currentLayoutName >>= \d-> (if (d == "ResizableTall") then sendMessage Expand else sendMessage MirrorShrink)
dynamicShrink = currentLayoutName >>= \d-> (if (d == "ResizableTall") then sendMessage Shrink else sendMessage MirrorExpand)
dynamicMirrorExpand = currentLayoutName >>= \d-> (if (d == "ResizableTall") then sendMessage MirrorExpand else sendMessage Shrink)
dynamicMirrorShrink = currentLayoutName >>= \d-> (if (d == "ResizableTall") then sendMessage MirrorShrink else sendMessage Expand)


-- Audio control functions
audioAdjust			= "2"
audioLowerVolume 	= spawn $ "pamixer --decrease "++audioAdjust
audioRaiseVolume	= spawn $ "pamixer --increase "++audioAdjust
audioMute			= spawn "pamixer --toggle-mute"
audioPlay			= spawn "playerctl play-pause"
audioStop			= spawn "playerctl stop"
audioPrev			= spawn "playerctl previous"
audioNext			= spawn "playerctl next"

-- set sound output
ssoCommand x		= "~/pulsescripts/setoutput.sh "++x

Offline

#2 2014-07-18 18:05:30

shmoogin
Member
Registered: 2014-01-20
Posts: 3

Re: Full screen games (from Steam) in XMonad invisible

I'm also having this same issue, using the i3 window manager in XFCE.

Offline

#3 2014-07-24 15:05:47

vially
Member
Registered: 2012-11-16
Posts: 6

Re: Full screen games (from Steam) in XMonad invisible

I have the exact same problem. The thing is they used to work earlier on (around one year and a half ago) but after an update they suddenly stopped working. The only solution for now is to run them in windowed mode.

Offline

#4 2014-12-27 04:46:34

fohrums
Member
Registered: 2014-08-07
Posts: 2

Re: Full screen games (from Steam) in XMonad invisible

yackeroeni wrote:

Hi,

I've been trying to get games to work on my new setup and have problems running games in fullscreen mode.
...
I can hear the sound of the game, but am unable to see it or, as far as I know, interact with it

Literally using Xmonad for the first time and I experienced some game issues with fullscreen. Specifically when running CS:GO I had a problem where the resolution was native to my monitor (1920x1080) it was running windowed and I couldn't find a way to resize it unless moving it to a blank workspace (so other windows don't infere with the mouse hook) and your then able to drag the window by xmonad commands:

       mod-button1
              Set the window to floating mode and move by dragging

       mod-button2
              Raise the window to the top of the stack

       mod-button3
              Set the window to floating mode and resize by dragging
yackeroeni wrote:

(running steam games) launching dota 2 with the '-windowed' flag works fine.

Correct me if i'm wrong, but I believe the linux native games on steam use the concept of '-windowed' by default.

Offline

#5 2017-06-09 21:04:28

madgodofmagic
Member
Registered: 2017-06-09
Posts: 1

Re: Full screen games (from Steam) in XMonad invisible

Believe it or not, I think I've found the solution.
It looks like you need to apply the ewmh function before passing the config to xmonad, which, I'm guessing, initialises ewmh support on (re)start/reload — my full config:

import XMonad(xmonad,ManageHook,terminal,modMask,handleEventHook,manageHook,layoutHook,startupHook,borderWidth,(<+>),spawn,mod4Mask,(-->))
import XMonad.Config.Desktop(desktopConfig)
import XMonad.Util.Scratchpad(scratchpadManageHook,scratchpadSpawnActionTerminal)
import XMonad.StackSet(RationalRect(RationalRect))
import XMonad.Util.EZConfig(additionalKeysP)
import XMonad.Hooks.ManageDocks(manageDocks,avoidStruts)
import XMonad.Hooks.EwmhDesktops(fullscreenEventHook,ewmh)
import XMonad.Hooks.ManageHelpers(doFullFloat,isFullscreen)
manageScratchPad :: ManageHook
manageScratchPad = scratchpadManageHook (RationalRect l t w h)
  where
    h = 0.7
    w = 1
    t = 0
    l = 0
main :: IO ()
main = do
  let myTerminal = "konsole"
      myManageHook = manageDocks <+> manageHook desktopConfig <+> manageScratchPad <+> (isFullscreen --> doFullFloat)
      scratchPad = scratchpadSpawnActionTerminal myTerminal
      myHandleEventHook = handleEventHook desktopConfig <+> fullscreenEventHook
      myLayoutHook = avoidStruts $ layoutHook desktopConfig
      myStartupHook = mapM_ spawn ["google-chrome-stable","qbittorrent","pavucontrol","xmobar"]
  xmonad $ ewmh $ desktopConfig
    { terminal    = myTerminal
    , modMask     = mod4Mask
    , handleEventHook = myHandleEventHook
    , manageHook = myManageHook
    , layoutHook = myLayoutHook
    , startupHook = myStartupHook
    , borderWidth = 0
    }  `additionalKeysP` [("<F12>", scratchPad), ("<Print>", spawn "spectacle")]

Ever since I've updated it like this, things like Borderlands 2, SOMA, etc. launch correctly in a floating window when 'fullscreen'.

Offline

#6 2017-06-09 21:20:59

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,723

Re: Full screen games (from Steam) in XMonad invisible

Thanks for sharing a potential solution, however be aware that this thread is 3 years old and as such, the OP might not be looking for a solution anymore and/or the problem has a different cause.

I'm going to close this old topic now.

Offline

Board footer

Powered by FluxBB