From 7c3e4b7040cf21a11b259571c676e4fc244367ad Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 19 Jan 2013 11:07:19 +0000 Subject: fixed playlist resize on RTL locales git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3174 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Ui/skinned/windowsystem.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/plugins/Ui/skinned/windowsystem.cpp') diff --git a/src/plugins/Ui/skinned/windowsystem.cpp b/src/plugins/Ui/skinned/windowsystem.cpp index 75a95eca9..4738f6f5f 100644 --- a/src/plugins/Ui/skinned/windowsystem.cpp +++ b/src/plugins/Ui/skinned/windowsystem.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * Based on Licq * * Copyright (C) 2006-2009 Licq developers * - * Copyright (C) 2011 Ilya Kotov * + * Copyright (C) 2011-2013 Ilya Kotov * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -209,5 +209,23 @@ unsigned char* WindowSystem::getWindowProperty(WId win, const char* prop) return retValue; } +//On RTL locales Qt sets flag NorthEastGravity for windows. +//This function reverts these changes. +void WindowSystem::revertGravity(WId win) +{ + Display* dsp = QX11Info::display(); + XSizeHints sh; + memset(&sh, 0, sizeof(sh)); + long unused; + XGetWMNormalHints(dsp, win, &sh, &unused); + sh.flags |= PWinGravity; + + if(sh.win_gravity == NorthEastGravity) + sh.win_gravity = NorthWestGravity; + else + return; + sh.win_gravity = NorthWestGravity; + XSetWMNormalHints(dsp, win, &sh); +} #endif -- cgit v1.2.3-13-gbd6f