Merge lp:~openerp-dev/openobject-client/6.1-opw-579680-xal into lp:openobject-client/6.1

Proposed by Xavier ALT
Status: Merged
Approved by: Xavier ALT
Approved revision: 2097
Merged at revision: 2098
Proposed branch: lp:~openerp-dev/openobject-client/6.1-opw-579680-xal
Merge into: lp:openobject-client/6.1
Diff against target: 32 lines (+4/-4)
1 file modified
bin/tools/win32.py (+4/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.1-opw-579680-xal
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+129204@code.launchpad.net

Description of the change

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

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
23import datetime23import datetime
24import locale24import locale
2525
26import win32ui26from ctypes import windll
27import win32con27import win32con
28try:28try:
29 import winxpgui as win32gui29 import winxpgui as win32gui
@@ -46,16 +46,16 @@
4646
47def get_systemfont_style():47def get_systemfont_style():
48 # Get DC48 # Get DC
49 hdc = win32gui.GetDC(0)49 hdc = windll.user32.GetDC(0)
50 # Get system DPI50 # Get system DPI
51 dpi = win32ui.GetDeviceCaps(hdc, win32con.LOGPIXELSY)51 dpi = windll.gdi32.GetDeviceCaps(hdc, win32con.LOGPIXELSY)
52 # Get system font, it's name and size52 # Get system font, it's name and size
53 z = win32gui.SystemParametersInfo(win32con.SPI_GETNONCLIENTMETRICS)53 z = win32gui.SystemParametersInfo(win32con.SPI_GETNONCLIENTMETRICS)
54 font = z['lfMessageFont']54 font = z['lfMessageFont']
55 font_name = font.lfFaceName55 font_name = font.lfFaceName
56 font_size = int(round(abs(font.lfHeight) * 72 / dpi))56 font_size = int(round(abs(font.lfHeight) * 72 / dpi))
57 # Release DC57 # Release DC
58 win32gui.ReleaseDC(0, hdc)58 windll.user32.ReleaseDC(0, hdc)
59 # Construct sytle for all widget59 # Construct sytle for all widget
60 font_style = '''60 font_style = '''
61 style "openerp-user-font" {61 style "openerp-user-font" {

Subscribers

People subscribed via source and target branches