> Thanks for looking into this. I had missed the fact that
> fullscreen_hook can be called even when the fullscreen frame parameter
> does not change (e.g., from x_set_font). I have cleaned/shortened your
> fix a little; new patch is attached.
The patch I sent earlier today was broken. Here is a better one. I
have removed the ConstrainWindowToScreen call completely: It should
never be needed, as we leave full-screen mode whenever the displays are
reconfigured, and the system automatically moves the window as necessary
at that point.
Vebjorn
--~--~---------~--~----~------------~-------~--~----~
Carbon Emacs User Group
http://groups.google.com/group/carbon-emacs?hl=en
-~----------~----~----~----~------~----~------~--~---
--- /Users/ljosa/tmp/foo/CarbonEmacs/emacs/src/macterm.c 2008-07-15 09:50:48.000000000 -0400
+++ macterm.c 2008-07-15 11:17:11.000000000 -0400
@@ -9654,7 +9654,7 @@
{
Rect b;
OSStatus st;
-
+
if (f->async_visible)
{
/* May signal errors, so do before blocking input. */
@@ -9662,20 +9662,20 @@
BLOCK_INPUT;
- /* Must get the current bounds before removing the title bar,
+ /* Must get the current bounds _before_ removing the title bar,
otherwise the window will be too short when restored. */
st = GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowStructureRgn, &b);
if (st != noErr)
{
UNBLOCK_INPUT;
- error("Failed to get current window bounds.");
+ error ("Failed to get current window bounds.");
}
CGDirectDisplayID display = mac_display_id (FRAME_MAC_WINDOW(f));
if (!display)
{
UNBLOCK_INPUT;
- error("Failed to get display ID.");
+ error ("Failed to get display ID.");
}
CGDirectDisplayID main_display = CGMainDisplayID ();
if ((f->want_fullscreen & FULLSCREEN_BOTH) == FULLSCREEN_BOTH)
@@ -9724,11 +9724,6 @@
SetWindowBounds(FRAME_MAC_WINDOW (f), kWindowStructureRgn, &b);
- /* Resize and/or move the frame as needed in case the saved
- bounds aren't acceptable for the current display. */
- ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowStructureRgn,
- kWindowConstrainStandardOptions, NULL, NULL);
-
/* Necessary because x_set_offset and x_set_window_size refuse
to change the offset and size of a full-screen frame. */
st = GetWindowBounds(FRAME_MAC_WINDOW (f), kWindowContentRgn, &b);