mirror of
https://github.com/aclist/dztui.git
synced 2024-12-29 13:52:03 +01:00
fix: force fullscreen on GM
This commit is contained in:
parent
e197e07e84
commit
a1689b5677
3 changed files with 30 additions and 17 deletions
20
dzgui.sh
20
dzgui.sh
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o pipefail
|
||||
|
||||
version=5.0.0.rc-37
|
||||
version=5.0.0.rc-38
|
||||
|
||||
#CONSTANTS
|
||||
aid=221100
|
||||
|
@ -370,10 +370,22 @@ dl_changelog(){
|
|||
local md="https://raw.githubusercontent.com/$author/dztui/${mdbranch}/CHANGELOG.md"
|
||||
curl -Ls "$md" > "$state_path/CHANGELOG.md"
|
||||
}
|
||||
test_display_mode(){
|
||||
pgrep -a gamescope | grep -q "generate-drm-mode"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo gm
|
||||
else
|
||||
echo dm
|
||||
fi
|
||||
}
|
||||
check_architecture(){
|
||||
local cpu=$(< /proc/cpuinfo grep "AMD Custom APU 0405")
|
||||
if [[ -n "$cpu" ]]; then
|
||||
if [[ $(test_display_mode) == "gm" ]]; then
|
||||
is_steam_deck=2
|
||||
else
|
||||
is_steam_deck=1
|
||||
fi
|
||||
logger INFO "Setting architecture to 'Steam Deck'"
|
||||
else
|
||||
is_steam_deck=0
|
||||
|
@ -536,10 +548,10 @@ fetch_dzq(){
|
|||
fetch_helpers_by_sum(){
|
||||
declare -A sums
|
||||
sums=(
|
||||
["ui.py"]="26032cc056ff1ce25660a2ca58cffc81"
|
||||
["ui.py"]="79f21f63a704389d5aec0731c75b5e0f"
|
||||
["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197"
|
||||
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
||||
["funcs"]="4f142d4fe883a6936f94c964dbcf0710"
|
||||
["funcs"]="e49f7a123134d49f622dba9b671b000e"
|
||||
)
|
||||
local author="aclist"
|
||||
local repo="dztui"
|
||||
|
@ -812,7 +824,7 @@ initial_setup(){
|
|||
steam_deps
|
||||
migrate_files
|
||||
stale_symlinks
|
||||
fetch_helpers > >(pdialog "Checking helper files")
|
||||
# fetch_helpers > >(pdialog "Checking helper files")
|
||||
local_latlon
|
||||
is_steam_running
|
||||
is_dzg_downloading
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o pipefail
|
||||
version=5.0.0.rc-37
|
||||
version=5.0.0.rc-38
|
||||
|
||||
#CONSTANTS
|
||||
aid=221100
|
||||
|
|
|
@ -16,7 +16,7 @@ locale.setlocale(locale.LC_ALL, '')
|
|||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GLib, Gdk, GObject, Pango
|
||||
|
||||
# 5.0.0-rc.37
|
||||
# 5.0.0-rc.38
|
||||
app_name = "DZGUI"
|
||||
|
||||
cache = {}
|
||||
|
@ -435,7 +435,7 @@ def reinit_checks():
|
|||
|
||||
|
||||
class OuterWindow(Gtk.Window):
|
||||
def __init__(self, is_steam_deck):
|
||||
def __init__(self, is_steam_deck, is_game_mode):
|
||||
super().__init__(title=app_name)
|
||||
|
||||
self.connect("delete-event", self.halt_proc_and_quit)
|
||||
|
@ -449,14 +449,10 @@ class OuterWindow(Gtk.Window):
|
|||
"""
|
||||
self.grid = Grid(is_steam_deck)
|
||||
self.add(self.grid)
|
||||
# self.hb = AppHeaderBar()
|
||||
|
||||
# if is_steam_deck is True:
|
||||
# self.maximize()
|
||||
# self.set_decorated(False)
|
||||
# else:
|
||||
# pass
|
||||
# self.set_titlebar(self.hb)
|
||||
if is_game_mode is True:
|
||||
self.fullscreen()
|
||||
else:
|
||||
self.maximize()
|
||||
|
||||
# Hide FilterPanel on main menu
|
||||
self.show_all()
|
||||
|
@ -1485,10 +1481,15 @@ class App(Gtk.Application):
|
|||
_isd = int(sys.argv[3])
|
||||
if _isd == 1:
|
||||
is_steam_deck = True
|
||||
is_game_mode = False
|
||||
elif _isd == 2:
|
||||
is_steam_deck = True
|
||||
is_game_mode = True
|
||||
else:
|
||||
is_steam_deck = False
|
||||
is_game_mode = False
|
||||
|
||||
self.win = OuterWindow(is_steam_deck)
|
||||
self.win = OuterWindow(is_steam_deck, is_game_mode)
|
||||
|
||||
accel = Gtk.AccelGroup()
|
||||
accel.connect(Gdk.KEY_q, Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE, self._halt_window_subprocess)
|
||||
|
|
Loading…
Reference in a new issue