| 148 | } |
| 149 | |
| 150 | void WinShadow::moveShadow() |
| 151 | { |
| 152 | WINDOWPLACEMENT wp; |
| 153 | wp.length = sizeof(WINDOWPLACEMENT); |
| 154 | GetWindowPlacement(m_hwnd, &wp); |
| 155 | |
| 156 | if (wp.showCmd == SW_SHOWNORMAL){ |
| 157 | |
| 158 | RECT rc; |
| 159 | GetWindowRect(m_hwnd, &rc); |
| 160 | |
| 161 | int bw = (SHADOW_BORDER_WIDTH - 1) * m_scale; |
| 162 | |
| 163 | int x = rc.left; |
| 164 | int y = rc.top; |
| 165 | int w = rc.right - rc.left; |
| 166 | int h = rc.bottom - rc.top; |
| 167 | |
| 168 | x -= bw; |
| 169 | y -= bw; |
| 170 | w += bw * 2; |
| 171 | h += bw * 2; |
| 172 | |
| 173 | const HWND active_window = GetActiveWindow(); |
| 174 | bool isActiveWindow = ((active_window == m_hwnd) |
| 175 | || IsChild(m_hwnd, active_window)); |
| 176 | |
| 177 | MoveWindow((HWND)winId(), x, y, w , h , 1); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | void WinShadow::paintEvent(QPaintEvent *event) |
| 182 | { |