comparison src/gtkutil.c @ 103686:49c52a6beed8

(xg_frame_set_char_size): Do not set pixel width/height here or call change_frame_size.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 02 Jul 2009 07:48:23 +0000
parents 34f3338fd2bf
children b14ad5a1ef66
comparison
equal deleted inserted replaced
103685:efcbacf4ad40 103686:49c52a6beed8
623 else if (f->size_hint_flags & PPosition) 623 else if (f->size_hint_flags & PPosition)
624 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 624 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
625 f->left_pos, f->top_pos); 625 f->left_pos, f->top_pos);
626 } 626 }
627 627
628
629 /* Function to handle resize of our frame. As we have a Gtk+ tool bar 628 /* Function to handle resize of our frame. As we have a Gtk+ tool bar
630 and a Gtk+ menu bar, we get resize events for the edit part of the 629 and a Gtk+ menu bar, we get resize events for the edit part of the
631 frame only. We let Gtk+ deal with the Gtk+ parts. 630 frame only. We let Gtk+ deal with the Gtk+ parts.
632 F is the frame to resize. 631 F is the frame to resize.
633 PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */ 632 PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */
654 cancel_mouse_face (f); 653 cancel_mouse_face (f);
655 } 654 }
656 } 655 }
657 656
658 /* Resize the outer window of frame F after chainging the height. 657 /* Resize the outer window of frame F after chainging the height.
659 This happend when the menu bar or the tool bar is added or removed.
660 COLUMNS/ROWS is the size the edit area shall have after the resize. */ 658 COLUMNS/ROWS is the size the edit area shall have after the resize. */
661 659
662 void 660 void
663 xg_frame_set_char_size (f, cols, rows) 661 xg_frame_set_char_size (f, cols, rows)
664 FRAME_PTR f; 662 FRAME_PTR f;
690 but not rows/cols. */ 688 but not rows/cols. */
691 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 689 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
692 pixelwidth, pixelheight); 690 pixelwidth, pixelheight);
693 x_wm_set_size_hint (f, 0, 0); 691 x_wm_set_size_hint (f, 0, 0);
694 692
695 /* Now, strictly speaking, we can't be sure that this is accurate,
696 but the window manager will get around to dealing with the size
697 change request eventually, and we'll hear how it went when the
698 ConfigureNotify event gets here.
699
700 We could just not bother storing any of this information here,
701 and let the ConfigureNotify event set everything up, but that
702 might be kind of confusing to the Lisp code, since size changes
703 wouldn't be reported in the frame parameters until some random
704 point in the future when the ConfigureNotify event arrives.
705
706 We pass 1 for DELAY since we can't run Lisp code inside of
707 a BLOCK_INPUT. */
708 change_frame_size (f, rows, cols, 0, 1, 0);
709 FRAME_PIXEL_WIDTH (f) = pixelwidth;
710 FRAME_PIXEL_HEIGHT (f) = pixelheight;
711
712 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
713 receive in the ConfigureNotify event; if we get what we asked
714 for, then the event won't cause the screen to become garbaged, so
715 we have to make sure to do it here. */
716 SET_FRAME_GARBAGED (f); 693 SET_FRAME_GARBAGED (f);
694
695 /* We can not call change_frame_size here, we can not set pixel
696 width/height either. The window manager may override our resize
697 request, XMonad does this all the time. The best we can do
698 is try to sync, so lisp code sees the updated size as fast as
699 possible. */
700 gdk_window_process_all_updates ();
701 x_sync (f);
717 } 702 }
718 703
719 /* Handle height changes (i.e. add/remove menu/toolbar). 704 /* Handle height changes (i.e. add/remove menu/toolbar).
720 The policy is to keep the number of editable lines. */ 705 The policy is to keep the number of editable lines. */
721 706