Skip to content

Commit

Permalink
#1309: show bit depth in server info output
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@15028 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 9, 2017
1 parent 4621aaf commit 8099628
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,17 @@ def print_run_info(self):
log.info(" uid=%i, gid=%i", uid, gid)
log.info(" running with pid %s%s", os.getpid(), osinfo)

def get_display_bit_depth(self):
return 0

def print_screen_info(self):
display = os.environ.get("DISPLAY")
if display and display.startswith(":"):
log.info(" connected to X11 display %s", display)
extra = ""
bit_depth = self.get_display_bit_depth()
if bit_depth:
extra = " with %i bit colors" % bit_depth
log.info(" connected to X11 display %s%s", display, extra)


def server_is_ready(self):
Expand Down
7 changes: 7 additions & 0 deletions src/xpra/x11/x11_server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
X11Keyboard = X11KeyboardBindings()
from xpra.x11.bindings.core_bindings import X11CoreBindings #@UnresolvedImport
X11Core = X11CoreBindings()
from xpra.x11.bindings.window_bindings import X11WindowBindings
X11Window = X11WindowBindings()
from xpra.gtk_common.error import XError, xswallow, xsync, trap
from xpra.gtk_common.gtk_util import get_xwindow
from xpra.server.server_uuid import save_uuid, get_uuid
Expand Down Expand Up @@ -140,6 +142,11 @@ def get_default_cursor():
trap.swallow_synced(get_default_cursor)
X11Keyboard.selectCursorChange(True)

def get_display_bit_depth(self):
with xswallow:
return X11Window.get_depth(X11Window.getDefaultRootWindow())
return 0

def query_opengl(self):
self.opengl_props = {}
try:
Expand Down

0 comments on commit 8099628

Please sign in to comment.