Permalink
Browse files

Bug fix for changes to "always on top" behavior

  • Loading branch information...
1 parent a239d6b commit 427f40848dd9868091f3ffe6c8dd2429809c0ff7 @xolox committed May 3, 2013
View
@@ -1,9 +1,9 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: May 2, 2013
+" Last Change: May 3, 2013
" URL: http://peterodding.com/code/vim/shell/
-let g:xolox#shell#version = '0.11'
+let g:xolox#shell#version = '0.11.2'
call xolox#misc#compat#check('shell', 2)
@@ -348,7 +348,7 @@ if xolox#misc#os#is_win()
function! s:has_dll() " {{{2
try
- return s:library_call('libversion', '') == '0.4'
+ return s:library_call('libversion', '') == '0.5'
catch
return 0
endtry
View
Binary file not shown.
View
Binary file not shown.
View
@@ -101,7 +101,7 @@ __declspec(dllexport)
const char *libversion(const char *ignored) /* {{{1 */
{
(void)ignored;
- return Success("0.4");
+ return Success("0.5");
}
__declspec(dllexport)
@@ -115,11 +115,13 @@ __declspec(dllexport)
const char *fullscreen(const char *options) /* {{{1 */
{
HWND window;
- LONG styles;
- LONG exStyle;
+ LONG styles, exStyle, enable, always_on_top;
HMONITOR monitor;
MONITORINFO info = { sizeof info };
+ enable = (strstr(options, "enable") != NULL);
+ always_on_top = (strstr(options, "always on top") != NULL);
+
window = GetForegroundWindow();
if (!window)
return Failure("Could not get handle to foreground window!");
@@ -132,13 +134,13 @@ const char *fullscreen(const char *options) /* {{{1 */
if (!exStyle)
return Failure("Could not query window ex style!");
- if (strstr(options, "enable")) {
+ if (enable) {
styles ^= WS_CAPTION | WS_THICKFRAME;
- if (strstr(options, "always on top"))
+ if (always_on_top)
exStyle |= WS_EX_TOPMOST;
} else {
styles |= WS_CAPTION | WS_THICKFRAME;
- if (strstr(options, "always on top"))
+ if (always_on_top)
exStyle &= ~WS_EX_TOPMOST;
}
@@ -148,13 +150,14 @@ const char *fullscreen(const char *options) /* {{{1 */
if (!SetWindowLong(window, GWL_EXSTYLE, exStyle))
return Failure("Could not apply window ex style!");
- if (strstr(options, "enable")) {
+ if (enable) {
monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST);
if (!monitor)
return Failure("Could not get handle to monitor!");
if (!GetMonitorInfo(monitor, &info))
return Failure("Could not get monitor information!");
- if (!SetWindowPos(window, HWND_TOPMOST,
+ if (!SetWindowPos(window,
+ always_on_top ? HWND_TOPMOST : HWND_TOP,
info.rcMonitor.left,
info.rcMonitor.top,
info.rcMonitor.right - info.rcMonitor.left,

0 comments on commit 427f408

Please sign in to comment.