Xavier ALT (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client/6.1-opw-579680-xal into 
lp:openobject-client/6.1.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #940408 in OpenERP GTK Client: "GTK Client 6.1.1 hang on exit in windows 
7 Professional 32 bits"
  https://bugs.launchpad.net/openobject-client/+bug/940408

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/6.1-opw-579680-xal/+merge/129204

Hi,

On Win7 after doing an 'import win32ui', python process will not exit properly 
anymore. This workaround this bug by using ctypes.windll directly.

Regards,
Xavier
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/6.1-opw-579680-xal/+merge/129204
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client/6.1-opw-579680-xal.
=== modified file 'bin/tools/win32.py'
--- bin/tools/win32.py	2011-11-22 09:03:26 +0000
+++ bin/tools/win32.py	2012-10-11 14:13:25 +0000
@@ -23,7 +23,7 @@
 import datetime
 import locale
 
-import win32ui
+from ctypes import windll
 import win32con
 try:
     import winxpgui as win32gui
@@ -46,16 +46,16 @@
 
 def get_systemfont_style():
     # Get DC
-    hdc = win32gui.GetDC(0)
+    hdc = windll.user32.GetDC(0)
     # Get system DPI
-    dpi = win32ui.GetDeviceCaps(hdc, win32con.LOGPIXELSY)
+    dpi = windll.gdi32.GetDeviceCaps(hdc, win32con.LOGPIXELSY)
     # Get system font, it's name and size
     z = win32gui.SystemParametersInfo(win32con.SPI_GETNONCLIENTMETRICS)
     font = z['lfMessageFont']
     font_name = font.lfFaceName
     font_size = int(round(abs(font.lfHeight) * 72 / dpi))
     # Release DC
-    win32gui.ReleaseDC(0, hdc)
+    windll.user32.ReleaseDC(0, hdc)
     # Construct sytle for all widget
     font_style = '''
         style "openerp-user-font" {

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to