emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32fns.c


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/w32fns.c
Date: Sun, 17 Feb 2002 18:44:09 -0500

Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.154 emacs/src/w32fns.c:1.155
*** emacs/src/w32fns.c:1.154    Fri Feb  8 20:31:07 2002
--- emacs/src/w32fns.c  Sun Feb 17 18:44:09 2002
***************
*** 270,275 ****
--- 270,280 ----
  Lisp_Object Qw32_charset_unicode;
  #endif
  
+ Lisp_Object Qfullscreen;
+ Lisp_Object Qfullwidth;
+ Lisp_Object Qfullheight;
+ Lisp_Object Qfullboth;
+ 
  extern Lisp_Object Qtop;
  extern Lisp_Object Qdisplay;
  extern Lisp_Object Qtool_bar_lines;
***************
*** 681,686 ****
--- 686,692 ----
  /* TODO: Native Input Method support; see x_create_im.  */
  void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
  static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, 
Lisp_Object));
+ static void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
  void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
  void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
  void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
***************
*** 734,740 ****
    {"screen-gamma", x_set_screen_gamma},
    {"line-spacing", x_set_line_spacing},
    {"left-fringe", x_set_fringe_width},
!   {"right-fringe", x_set_fringe_width}
  };
  
  /* Attach the `x-frame-parameter' properties to
--- 740,747 ----
    {"screen-gamma", x_set_screen_gamma},
    {"line-spacing", x_set_line_spacing},
    {"left-fringe", x_set_fringe_width},
!   {"right-fringe", x_set_fringe_width},
!   {"fullscreen", x_set_fullscreen},
  };
  
  /* Attach the `x-frame-parameter' properties to
***************
*** 750,755 ****
--- 757,783 ----
          make_number (i));
  }
  
+ /* Really try to move where we want to be in case of fullscreen.  Some WMs
+    moves the window where we tell them.  Some (mwm, twm) moves the outer
+    window manager window there instead.
+    Try to compensate for those WM here. */
+ static void
+ x_fullscreen_move (f, new_top, new_left)
+      struct frame *f;
+      int new_top;
+      int new_left;
+ {
+   if (new_top != f->output_data.w32->top_pos
+       || new_left != f->output_data.w32->left_pos)
+     {
+       int move_x = new_left;
+       int move_y = new_top;
+ 
+       f->output_data.w32->want_fullscreen |= FULLSCREEN_MOVE_WAIT;
+       x_set_offset (f, move_x, move_y, 1);
+     }
+ }
+ 
  /* Change the parameters of frame F as specified by ALIST.
     If a parameter is not specially recognized, do nothing;
     otherwise call the `x_set_...' function for that parameter.  */
***************
*** 778,783 ****
--- 806,812 ----
    int i, p;
    int left_no_change = 0, top_no_change = 0;
    int icon_left_no_change = 0, icon_top_no_change = 0;
+   int fullscreen_is_being_set = 0;
  
    struct gcpro gcpro1, gcpro2;
  
***************
*** 835,845 ****
        val = values[p];
        if (EQ (prop, Qforeground_color)
          || EQ (prop, Qbackground_color)
!         || EQ (prop, Qfont))
        {
          register Lisp_Object param_index, old_value;
  
          old_value = get_frame_param (f, prop);
  
          if (NILP (Fequal (val, old_value)))
            {
--- 864,876 ----
        val = values[p];
        if (EQ (prop, Qforeground_color)
          || EQ (prop, Qbackground_color)
!         || EQ (prop, Qfont)
!         || EQ (prop, Qfullscreen))
        {
          register Lisp_Object param_index, old_value;
  
          old_value = get_frame_param (f, prop);
+         fullscreen_is_being_set |= EQ (prop, Qfullscreen);
  
          if (NILP (Fequal (val, old_value)))
            {
***************
*** 876,882 ****
        icon_left = val;
        else if (EQ (prop, Qforeground_color)
               || EQ (prop, Qbackground_color)
!              || EQ (prop, Qfont))
        /* Processed above.  */
        continue;
        else
--- 907,914 ----
        icon_left = val;
        else if (EQ (prop, Qforeground_color)
               || EQ (prop, Qbackground_color)
!              || EQ (prop, Qfont)
!              || EQ (prop, Qfullscreen))
        /* Processed above.  */
        continue;
        else
***************
*** 929,934 ****
--- 961,981 ----
        XSETINT (icon_top, 0);
      }
  
+   if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set)
+     {
+             /* If the frame is visible already and the fullscreen parameter is
+          being set, it is too late to set WM manager hints to specify
+          size and position.
+          Here we first get the width, height and position that applies to
+          fullscreen.  We then move the frame to the appropriate
+          position.  Resize of the frame is taken care of in the code after
+          this if-statement. */
+       int new_left, new_top;
+       
+       x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
+       x_fullscreen_move (f, new_top, new_left);
+     }
+ 
    /* Don't set these parameters unless they've been explicitly
       specified.  The window might be mapped or resized while we're in
       this function, and we don't want to override that unless the lisp
***************
*** 1032,1050 ****
       int *xptr, *yptr;
  {
    POINT pt;
  
!   {
!       RECT rect;
!       
!       GetClientRect(FRAME_W32_WINDOW(f), &rect);
!       AdjustWindowRect(&rect, f->output_data.w32->dwStyle, 
FRAME_EXTERNAL_MENU_BAR(f));
!       
!       pt.x = rect.left;
!       pt.y = rect.top;
!   }
  
    ClientToScreen (FRAME_W32_WINDOW(f), &pt);
  
    *xptr = pt.x;
    *yptr = pt.y;
  }
--- 1079,1098 ----
       int *xptr, *yptr;
  {
    POINT pt;
+   RECT rect;
  
!   GetClientRect(FRAME_W32_WINDOW(f), &rect);
!   AdjustWindowRect(&rect, f->output_data.w32->dwStyle, 
FRAME_EXTERNAL_MENU_BAR(f));
! 
!   pt.x = rect.left;
!   pt.y = rect.top;
  
    ClientToScreen (FRAME_W32_WINDOW(f), &pt);
  
+   /* Remember x_pixels_diff and y_pixels_diff.  */
+   f->output_data.w32->x_pixels_diff = pt.x - rect.left;
+   f->output_data.w32->y_pixels_diff = pt.y - rect.top;
+ 
    *xptr = pt.x;
    *yptr = pt.y;
  }
***************
*** 1967,1972 ****
--- 2015,2039 ----
  }
  
  
+ /* Change the `fullscreen' frame parameter of frame F.  OLD_VALUE is
+    the previous value of that parameter, NEW_VALUE is the new value. */
+ 
+ static void
+ x_set_fullscreen (f, new_value, old_value)
+      struct frame *f;
+      Lisp_Object new_value, old_value;
+ {
+   if (NILP (new_value))
+     f->output_data.w32->want_fullscreen = FULLSCREEN_NONE;
+   else if (EQ (new_value, Qfullboth))
+     f->output_data.w32->want_fullscreen = FULLSCREEN_BOTH;
+   else if (EQ (new_value, Qfullwidth))
+     f->output_data.w32->want_fullscreen = FULLSCREEN_WIDTH;
+   else if (EQ (new_value, Qfullheight))
+     f->output_data.w32->want_fullscreen = FULLSCREEN_HEIGHT;
+ }
+ 
+ 
  /* Change the `screen-gamma' frame parameter of frame F.  OLD_VALUE is
     the previous value of that parameter, NEW_VALUE is the new value.  */
  
***************
*** 3285,3291 ****
--- 3352,3360 ----
         : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
         ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
         : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
+ 
    x_compute_fringe_widths (f, 0);
+ 
    f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
    f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
  
***************
*** 3356,3361 ****
--- 3425,3446 ----
        window_prompting |= PPosition;
      }
  
+   if (f->output_data.w32->want_fullscreen != FULLSCREEN_NONE)
+     {
+       int left, top;
+       int width, height;
+ 
+       /* It takes both for some WM:s to place it where we want */
+       window_prompting = USPosition | PPosition;
+       x_fullscreen_adjust (f, &width, &height, &top, &left);
+       f->width = width;
+       f->height = height;
+       f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
+       f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
+       f->output_data.w32->left_pos = left;
+       f->output_data.w32->top_pos = top;
+     }
+ 
    return window_prompting;
  }
  
***************
*** 5564,5569 ****
--- 5649,5656 ----
                       "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
    x_default_parameter (f, parms, Qtitle, Qnil,
                       "title", "Title", RES_TYPE_STRING);
+   x_default_parameter (f, parms, Qfullscreen, Qnil,
+                        "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
  
    f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
    f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
***************
*** 5959,5968 ****
  
      /* Set global flag fonts_changed_p to non-zero if the font loaded
         has a character with a smaller width than any other character
!        before, or if the font loaded has a smalle>r height than any
         other font loaded before.  If this happens, it will make a
         glyph matrix reallocation necessary.  */
!     fonts_changed_p = x_compute_min_glyph_bounds (f);
      UNBLOCK_INPUT;
      return fontp;
    }
--- 6046,6055 ----
  
      /* Set global flag fonts_changed_p to non-zero if the font loaded
         has a character with a smaller width than any other character
!        before, or if the font loaded has a smaller height than any
         other font loaded before.  If this happens, it will make a
         glyph matrix reallocation necessary.  */
!     fonts_changed_p |= x_compute_min_glyph_bounds (f);
      UNBLOCK_INPUT;
      return fontp;
    }
***************
*** 14487,14495 ****
  
    w32_visible_system_caret_hwnd = NULL;
  
-   /* The section below is built by the lisp expression at the top of the file,
-      just above where these variables are declared.  */
-   /*&&& init symbols here &&&*/
    Qauto_raise = intern ("auto-raise");
    staticpro (&Qauto_raise);
    Qauto_lower = intern ("auto-lower");
--- 14574,14579 ----
***************
*** 14556,14562 ****
    staticpro (&Qcenter);
    Qcancel_timer = intern ("cancel-timer");
    staticpro (&Qcancel_timer);
!   /* This is the end of symbol initialization.  */
  
    Qhyper = intern ("hyper");
    staticpro (&Qhyper);
--- 14640,14653 ----
    staticpro (&Qcenter);
    Qcancel_timer = intern ("cancel-timer");
    staticpro (&Qcancel_timer);
!   Qfullscreen = intern ("fullscreen");
!   staticpro (&Qfullscreen);
!   Qfullwidth = intern ("fullwidth");
!   staticpro (&Qfullwidth);
!   Qfullheight = intern ("fullheight");
!   staticpro (&Qfullheight);
!   Qfullboth = intern ("fullboth");
!   staticpro (&Qfullboth);
  
    Qhyper = intern ("hyper");
    staticpro (&Qhyper);
***************
*** 14572,14577 ****
--- 14663,14669 ----
    staticpro (&Qcontrol);
    Qshift = intern ("shift");
    staticpro (&Qshift);
+   /* This is the end of symbol initialization.  */
  
    /* Text property `display' should be nonsticky by default.  */
    Vtext_property_default_nonsticky



reply via email to

[Prev in Thread] Current Thread [Next in Thread]