aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorEli Zaretskii2012-05-28 20:22:40 +0300
committerEli Zaretskii2012-05-28 20:22:40 +0300
commit85d0efd175d95b4aa23d6eb22b8f8d18ed03ba75 (patch)
tree195f2f5f8062ca238d977e8ebb60f4714d6a2190 /src/w32term.c
parentc00ea352d81609789cc9e0a20effb1b6869ff284 (diff)
downloademacs-85d0efd175d95b4aa23d6eb22b8f8d18ed03ba75.tar.gz
emacs-85d0efd175d95b4aa23d6eb22b8f8d18ed03ba75.zip
Fix bug #11513 with raise-frame on MS-Windows.
src/w32term.c (my_bring_window_to_top): New function. (x_raise_frame): Use handle returned by DeferWindowPos, which could be different from the original one. Call my_bring_window_to_top instead of my_set_foreground_window. src/w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP by calling BringWindowToTop. src/w32term.h (WM_EMACS_BRINGTOTOP): New message. (WM_EMACS_END): Increase by one.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 2ccd7574332..a90e067a3fd 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3492,6 +3492,12 @@ my_destroy_window (struct frame * f, HWND hwnd)
3492 (WPARAM) hwnd, 0); 3492 (WPARAM) hwnd, 0);
3493} 3493}
3494 3494
3495static void
3496my_bring_window_to_top (HWND hwnd)
3497{
3498 SendMessage (hwnd, WM_EMACS_BRINGTOTOP, (WPARAM) hwnd, 0);
3499}
3500
3495/* Create a scroll bar and return the scroll bar vector for it. W is 3501/* Create a scroll bar and return the scroll bar vector for it. W is
3496 the Emacs window on which to create the scroll bar. TOP, LEFT, 3502 the Emacs window on which to create the scroll bar. TOP, LEFT,
3497 WIDTH and HEIGHT are the pixel coordinates and dimensions of the 3503 WIDTH and HEIGHT are the pixel coordinates and dimensions of the
@@ -5600,24 +5606,27 @@ x_raise_frame (struct frame *f)
5600 HDWP handle = BeginDeferWindowPos (2); 5606 HDWP handle = BeginDeferWindowPos (2);
5601 if (handle) 5607 if (handle)
5602 { 5608 {
5603 DeferWindowPos (handle, 5609 handle = DeferWindowPos (handle,
5604 FRAME_W32_WINDOW (f), 5610 FRAME_W32_WINDOW (f),
5605 HWND_TOP, 5611 HWND_TOP,
5606 0, 0, 0, 0, 5612 0, 0, 0, 0,
5607 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); 5613 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
5608 5614 if (handle)
5609 DeferWindowPos (handle, 5615 {
5610 GetForegroundWindow (), 5616 handle = DeferWindowPos (handle,
5611 FRAME_W32_WINDOW (f), 5617 GetForegroundWindow (),
5612 0, 0, 0, 0, 5618 FRAME_W32_WINDOW (f),
5613 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); 5619 0, 0, 0, 0,
5614 5620 SWP_NOSIZE | SWP_NOMOVE |
5615 EndDeferWindowPos (handle); 5621 SWP_NOACTIVATE);
5622 if (handle)
5623 EndDeferWindowPos (handle);
5624 }
5616 } 5625 }
5617 } 5626 }
5618 else 5627 else
5619 { 5628 {
5620 my_set_foreground_window (FRAME_W32_WINDOW (f)); 5629 my_bring_window_to_top (FRAME_W32_WINDOW (f));
5621 } 5630 }
5622 5631
5623 UNBLOCK_INPUT; 5632 UNBLOCK_INPUT;