Skip to content

Commit

Permalink
#697: we must call SetProcessDpiAware() before loading GTK, because t…
Browse files Browse the repository at this point in the history
…he DLLs cache the results and we then end up with the wrong values!

git-svn-id: https://xpra.org/svn/Xpra/trunk@7823 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 29, 2014
1 parent c7ee43c commit 88e7e99
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/xpra/client/gl/gl_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,11 @@ def check_support(min_texture_size=0, force_enable=False, check_colormap=False):

def main():
from xpra.platform import init,clean
from xpra.platform.gui import init as gui_init
from xpra.util import pver
try:
init("OpenGL-Check")
gui_init()
verbose = "-v" in sys.argv or "--verbose" in sys.argv
if verbose:
log.enable_debug()
Expand Down
6 changes: 4 additions & 2 deletions src/xpra/client/gtk_base/bug_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import sys
import signal

from xpra.platform.gui import init as gui_init
gui_init()

from xpra.gtk_common.gobject_compat import import_gtk, import_gdk, import_gobject, import_pango, is_gtk3

gtk = import_gtk()
Expand Down Expand Up @@ -309,9 +312,8 @@ def do_save(self, filename):

def main():
from xpra.platform import init as platform_init
from xpra.platform.gui import init as gui_init, ready as gui_ready
from xpra.platform.gui import ready as gui_ready
platform_init("Xpra-Bug-Report", "Xpra Bug Report")
gui_init()

#logging init:
if "-v" in sys.argv:
Expand Down
5 changes: 4 additions & 1 deletion src/xpra/client/gtk_base/client_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import shlex
import signal

from xpra.platform.gui import init as gui_init
gui_init()

from xpra.gtk_common.gobject_compat import import_gtk, import_gdk, import_gobject, import_pango

gtk = import_gtk()
Expand Down Expand Up @@ -690,7 +693,7 @@ def main():
gtk_main_quit_on_fatal_exceptions_enable()

from xpra.platform import init as platform_init
from xpra.platform.gui import init as gui_init, ready as gui_ready
from xpra.platform.gui import ready as gui_ready
platform_init("Xpra-Launcher", "Xpra Connection Launcher")
gui_init()

Expand Down
3 changes: 1 addition & 2 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from xpra.client.keyboard_helper import KeyboardHelper
from xpra.platform import set_application_name
from xpra.platform.features import MMAP_SUPPORTED, SYSTEM_TRAY_SUPPORTED, CLIPBOARD_WANT_TARGETS, CLIPBOARD_GREEDY, CLIPBOARDS
from xpra.platform.gui import init as gui_init, ready as gui_ready, get_double_click_time, get_double_click_distance, get_native_notifier_classes, get_native_tray_classes, get_native_system_tray_classes, get_native_tray_menu_helper_classes, ClientExtras
from xpra.platform.gui import ready as gui_ready, get_double_click_time, get_double_click_distance, get_native_notifier_classes, get_native_tray_classes, get_native_system_tray_classes, get_native_tray_menu_helper_classes, ClientExtras
from xpra.codecs.codec_constants import get_PIL_decodings
from xpra.codecs.loader import codec_versions, has_codec, get_codec, PREFERED_ENCODING_ORDER, ALL_NEW_ENCODING_NAMES_TO_OLD, OLD_ENCODING_NAMES_TO_NEW, PROBLEMATIC_ENCODINGS
from xpra.codecs.video_helper import getVideoHelper, NO_GFX_CSC_OPTIONS
Expand Down Expand Up @@ -71,7 +71,6 @@ class UIXpraClient(XpraClientBase):
def __init__(self):
XpraClientBase.__init__(self)
log.info("xpra client version %s" % XPRA_VERSION)
gui_init()
self.start_time = time.time()
self._window_to_id = {}
self._id_to_window = {}
Expand Down
3 changes: 3 additions & 0 deletions src/xpra/gtk_common/gtk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import sys
import os.path

from xpra.platform.gui import init as gui_init
gui_init()

from xpra.gtk_common.gobject_compat import import_gtk, import_gdk, import_pixbufloader, import_pango, import_cairo, import_gobject, is_gtk3
gtk = import_gtk()
gdk = import_gdk()
Expand Down
4 changes: 3 additions & 1 deletion src/xpra/platform/gui.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# This file is part of Xpra.
# Copyright (C) 2010 Nathaniel Smith <[email protected]>
# Copyright (C) 2012-2013 Antoine Martin <[email protected]>
# Copyright (C) 2012-2014 Antoine Martin <[email protected]>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

import sys

_init_done = False
def init():
#warning: we currently call init() from multiple places to try
#to ensure we run it as early as possible..
global _init_done
if not _init_done:
_init_done = True
Expand Down
2 changes: 2 additions & 0 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,8 @@ def connect():
from xpra.client.gobject_client_base import DetachXpraClient
app = DetachXpraClient(connect(), opts)
else:
from xpra.platform.gui import init as gui_init
gui_init()
app = make_client(error_cb, opts)
layouts = app.get_supported_window_layouts() or ["default"]
layouts_str = ", ".join(layouts)
Expand Down

0 comments on commit 88e7e99

Please sign in to comment.