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
1=== modified file 'bin/tools/win32.py'
2--- bin/tools/win32.py 2011-11-22 09:03:26 +0000
3+++ bin/tools/win32.py 2012-10-11 14:13:25 +0000
4@@ -23,7 +23,7 @@
5 import datetime
6 import locale
7
8-import win32ui
9+from ctypes import windll
10 import win32con
11 try:
12 import winxpgui as win32gui
13@@ -46,16 +46,16 @@
14
15 def get_systemfont_style():
16 # Get DC
17- hdc = win32gui.GetDC(0)
18+ hdc = windll.user32.GetDC(0)
19 # Get system DPI
20- dpi = win32ui.GetDeviceCaps(hdc, win32con.LOGPIXELSY)
21+ dpi = windll.gdi32.GetDeviceCaps(hdc, win32con.LOGPIXELSY)
22 # Get system font, it's name and size
23 z = win32gui.SystemParametersInfo(win32con.SPI_GETNONCLIENTMETRICS)
24 font = z['lfMessageFont']
25 font_name = font.lfFaceName
26 font_size = int(round(abs(font.lfHeight) * 72 / dpi))
27 # Release DC
28- win32gui.ReleaseDC(0, hdc)
29+ windll.user32.ReleaseDC(0, hdc)
30 # Construct sytle for all widget
31 font_style = '''
32 style "openerp-user-font" {

Subscribers

People subscribed via source and target branches