aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-02-13 08:18:46 -0500
committerEli Zaretskii2010-02-13 08:18:46 -0500
commit36447e8d1f292611ce4db90e8fda8f3e25333747 (patch)
treeff731eb7f0b9651d55808eaa167e2e6dd5bc3fa1 /src
parent9a0d7cf1aaffb76aaf4a94f5124795dd9d7c8aed (diff)
parent98599f74d03c2dd4b6ac90d68266c508c5e0342e (diff)
downloademacs-36447e8d1f292611ce4db90e8fda8f3e25333747.tar.gz
emacs-36447e8d1f292611ce4db90e8fda8f3e25333747.zip
Merge from mainline.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog34
-rw-r--r--src/nsfont.m8
-rw-r--r--src/xsmfns.c62
-rw-r--r--src/xterm.c5
4 files changed, 79 insertions, 30 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4837d8ecb06..a48194a90aa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12010-02-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xterm.c (x_clear_frame_area): Cal gtk_widget_queue_draw if USE_GTK,
4 bug #5571.
5
62010-02-10 Jan Djärv <jan.h.d@swipnet.se>
7
8 * xsmfns.c (x_session_initialize): Move initialization of ice_fd and
9 doing_interact here.
10 (ice_connection_closed): New function.
11 (x_session_check_input, smc_die_CB, ice_io_error_handler)
12 (ice_conn_watch_CB, x_session_close): Call ice_connection_closed.
13 (x_session_check_input): Call IceCloseConnection if IceProcessMessages
14 returns I/O error.
15 (ice_conn_watch_CB): Call add_keyboard_wait_descriptor on ice_fd,
16 bug #5512.
17
182010-02-08 Francis Devereux <francis@devrx.org> (tiny change)
19
20 * nsfont.m (nsfont_open): The system's value for the font descent
21 is negative, so round it down to avoid clipping.
22
12010-02-06 Chong Yidong <cyd@stupidchicken.com> 232010-02-06 Chong Yidong <cyd@stupidchicken.com>
2 24
3 * charset.c (load_charset_map_from_file) 25 * charset.c (load_charset_map_from_file)
@@ -78,7 +100,7 @@
782010-01-25 Jan Djärv <jan.h.d@swipnet.se> 1002010-01-25 Jan Djärv <jan.h.d@swipnet.se>
79 101
80 * xfns.c (Fx_create_frame): If frame height is too big, try 102 * xfns.c (Fx_create_frame): If frame height is too big, try
81 sizes 24 and 10. Bug #3643. 103 sizes 24 and 10. Bug #3643.
82 104
832010-01-24 Stefan Monnier <monnier@iro.umontreal.ca> 1052010-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
84 106
@@ -165,7 +187,7 @@
165 * xfns.c (x_get_current_desktop, x_get_desktop_workarea): New functions. 187 * xfns.c (x_get_current_desktop, x_get_desktop_workarea): New functions.
166 (Fx_create_frame): Call x_get_current_desktop and x_get_desktop_workarea 188 (Fx_create_frame): Call x_get_current_desktop and x_get_desktop_workarea
167 to find out usable size of the desktop. Don't make frames larger than 189 to find out usable size of the desktop. Don't make frames larger than
168 this. Bug #3643. 190 this. Bug #3643.
169 191
1702010-01-15 Kenichi Handa <handa@m17n.org> 1922010-01-15 Kenichi Handa <handa@m17n.org>
171 193
@@ -310,7 +332,7 @@
310 332
3112010-01-08 Jan Djärv <jan.h.d@swipnet.se> 3332010-01-08 Jan Djärv <jan.h.d@swipnet.se>
312 334
313 * dispnew.c (change_frame_size_1): newwidth == FRAME_COLS (f) must 335 * dispnew.c (change_frame_size_1): newwidth == FRAME_COLS (f) must
314 also be true before we can return early (bug #5339). 336 also be true before we can return early (bug #5339).
315 337
3162010-01-06 David Reitter <david.reitter@gmail.com> 3382010-01-06 David Reitter <david.reitter@gmail.com>
@@ -342,7 +364,7 @@
342 364
343 * xterm.c (x_new_font): Move code for setting rows/cols before 365 * xterm.c (x_new_font): Move code for setting rows/cols before
344 resizing ... 366 resizing ...
345 (x_set_window_size): ... to here. bug #2568. 367 (x_set_window_size): ... to here. Bug #2568.
346 368
347 * gtkutil.c (xg_clear_under_internal_border): New function. 369 * gtkutil.c (xg_clear_under_internal_border): New function.
348 (xg_frame_resized, xg_frame_set_char_size): 370 (xg_frame_resized, xg_frame_set_char_size):
@@ -1581,7 +1603,7 @@
1581 Fix printf format. 1603 Fix printf format.
1582 (ns_query_color): Use CGFloat where appropriate. 1604 (ns_query_color): Use CGFloat where appropriate.
1583 (EmacsView<NSTextInput>, EmacsScroller): Fix method signatures. 1605 (EmacsView<NSTextInput>, EmacsScroller): Fix method signatures.
1584 (EmacsScroller-mouseDown:) Use long format in printf, and cast 1606 (EmacsScroller-mouseDown:): Use long format in printf, and cast
1585 argument. 1607 argument.
1586 1608
1587 * config.in (NS_HAVE_NSINTEGER): Drop. 1609 * config.in (NS_HAVE_NSINTEGER): Drop.
@@ -4057,7 +4079,7 @@
4057 4079
40582009-02-12 Stefan Monnier <monnier@iro.umontreal.ca> 40802009-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
4059 4081
4060 * keyboard.c (adjust_point_for_property): Allow stopping betwen two 4082 * keyboard.c (adjust_point_for_property): Allow stopping between two
4061 invisible areas. 4083 invisible areas.
4062 4084
40632009-02-12 Jason Rumney <jasonr@gnu.org> 40852009-02-12 Jason Rumney <jasonr@gnu.org>
diff --git a/src/nsfont.m b/src/nsfont.m
index d5107f376dd..97d74a82f2b 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -844,8 +844,10 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
844 /* max bounds */ 844 /* max bounds */
845 font_info->max_bounds.ascent = 845 font_info->max_bounds.ascent =
846 lrint (hshrink * [sfont ascender] + expand * hd/2); 846 lrint (hshrink * [sfont ascender] + expand * hd/2);
847 /* [sfont descender] is usually negative. Use floor to avoid
848 clipping descenders. */
847 font_info->max_bounds.descent = 849 font_info->max_bounds.descent =
848 -lrint (hshrink* [sfont descender] - expand*hd/2); 850 -lrint (floor(hshrink* [sfont descender] - expand*hd/2));
849 font_info->height = 851 font_info->height =
850 font_info->max_bounds.ascent + font_info->max_bounds.descent; 852 font_info->max_bounds.ascent + font_info->max_bounds.descent;
851 font_info->max_bounds.width = lrint (font_info->width); 853 font_info->max_bounds.width = lrint (font_info->width);
@@ -880,8 +882,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
880#endif 882#endif
881 883
882 /* set up metrics portion of font struct */ 884 /* set up metrics portion of font struct */
883 font->ascent = [sfont ascender]; 885 font->ascent = lrint([sfont ascender]);
884 font->descent = -[sfont descender]; 886 font->descent = -lrint(floor([sfont descender]));
885 font->min_width = ns_char_width(sfont, '|'); 887 font->min_width = ns_char_width(sfont, '|');
886 font->space_width = lrint (ns_char_width (sfont, ' ')); 888 font->space_width = lrint (ns_char_width (sfont, ' '));
887 font->average_width = lrint (font_info->width); 889 font->average_width = lrint (font_info->width);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 55035816bfd..ec5ca3b1a9f 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -52,11 +52,11 @@ static struct input_event emacs_event;
52 52
53/* The descriptor that we use to check for data from the session manager. */ 53/* The descriptor that we use to check for data from the session manager. */
54 54
55static int ice_fd = -1; 55static int ice_fd;
56 56
57/* A flag that says if we are in shutdown interactions or not. */ 57/* A flag that says if we are in shutdown interactions or not. */
58 58
59static int doing_interact = False; 59static int doing_interact;
60 60
61/* The session manager object for the session manager connection. */ 61/* The session manager object for the session manager connection. */
62 62
@@ -90,6 +90,14 @@ Lisp_Object Vx_session_previous_id;
90 90
91#define NOSPLASH_OPT "--no-splash" 91#define NOSPLASH_OPT "--no-splash"
92 92
93static void
94ice_connection_closed ()
95{
96 if (ice_fd >= 0)
97 delete_keyboard_wait_descriptor (ice_fd);
98 ice_fd = -1;
99}
100
93 101
94/* Handle any messages from the session manager. If no connection is 102/* Handle any messages from the session manager. If no connection is
95 open to a session manager, just return 0. 103 open to a session manager, just return 0.
@@ -101,9 +109,9 @@ x_session_check_input (bufp)
101{ 109{
102 SELECT_TYPE read_fds; 110 SELECT_TYPE read_fds;
103 EMACS_TIME tmout; 111 EMACS_TIME tmout;
112 int ret;
104 113
105 if (ice_fd == -1) return 0; 114 if (ice_fd == -1) return 0;
106
107 FD_ZERO (&read_fds); 115 FD_ZERO (&read_fds);
108 FD_SET (ice_fd, &read_fds); 116 FD_SET (ice_fd, &read_fds);
109 117
@@ -116,26 +124,33 @@ x_session_check_input (bufp)
116 will be called. */ 124 will be called. */
117 emacs_event.kind = NO_EVENT; 125 emacs_event.kind = NO_EVENT;
118 126
119 if (select (ice_fd+1, &read_fds, 127 ret = select (ice_fd+1, &read_fds,
120 (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout) < 0) 128 (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout);
129
130 if (ret < 0)
121 { 131 {
122 ice_fd = -1; 132 ice_connection_closed ();
123 return 0; 133 }
134 else if (ret > 0 && FD_ISSET (ice_fd, &read_fds))
135 {
136 ret = IceProcessMessages (SmcGetIceConnection (smc_conn),
137 (IceReplyWaitInfo *)0, (Bool *)0);
138 if (ret != IceProcessMessagesSuccess)
139 {
140 /* Either IO error or Connection closed. */
141 if (ret == IceProcessMessagesIOError)
142 IceCloseConnection (SmcGetIceConnection (smc_conn));
143
144 ice_connection_closed ();
145 }
124 } 146 }
125
126
127 if (FD_ISSET (ice_fd, &read_fds))
128 IceProcessMessages (SmcGetIceConnection (smc_conn),
129 (IceReplyWaitInfo *)0, (Bool *)0);
130
131 147
132 /* Check if smc_interact_CB was called and we shall generate a 148 /* Check if smc_interact_CB was called and we shall generate a
133 SAVE_SESSION_EVENT. */ 149 SAVE_SESSION_EVENT. */
134 if (emacs_event.kind == NO_EVENT) 150 if (emacs_event.kind != NO_EVENT)
135 return 0; 151 bcopy (&emacs_event, bufp, sizeof (struct input_event));
136 152
137 bcopy (&emacs_event, bufp, sizeof (struct input_event)); 153 return emacs_event.kind != NO_EVENT ? 1 : 0;
138 return 1;
139} 154}
140 155
141/* Return non-zero if we have a connection to a session manager. */ 156/* Return non-zero if we have a connection to a session manager. */
@@ -284,7 +299,7 @@ smc_die_CB (smcConn, clientData)
284 SmPointer clientData; 299 SmPointer clientData;
285{ 300{
286 SmcCloseConnection (smcConn, 0, 0); 301 SmcCloseConnection (smcConn, 0, 0);
287 ice_fd = -1; 302 ice_connection_closed ();
288} 303}
289 304
290/* We don't use the next two but they are mandatory, leave them empty. 305/* We don't use the next two but they are mandatory, leave them empty.
@@ -356,7 +371,7 @@ ice_io_error_handler (iceConn)
356 IceConn iceConn; 371 IceConn iceConn;
357{ 372{
358 /* Connection probably gone. */ 373 /* Connection probably gone. */
359 ice_fd = -1; 374 ice_connection_closed ();
360} 375}
361 376
362/* This is called when the ICE connection is created or closed. The SM library 377/* This is called when the ICE connection is created or closed. The SM library
@@ -371,7 +386,7 @@ ice_conn_watch_CB (iceConn, clientData, opening, watchData)
371{ 386{
372 if (! opening) 387 if (! opening)
373 { 388 {
374 ice_fd = -1; 389 ice_connection_closed ();
375 return; 390 return;
376 } 391 }
377 392
@@ -384,6 +399,8 @@ ice_conn_watch_CB (iceConn, clientData, opening, watchData)
384 if (interrupt_input) 399 if (interrupt_input)
385 init_sigio (ice_fd); 400 init_sigio (ice_fd);
386#endif /* ! defined (SIGIO) */ 401#endif /* ! defined (SIGIO) */
402
403 add_keyboard_wait_descriptor (ice_fd);
387} 404}
388 405
389/* Create the client leader window. */ 406/* Create the client leader window. */
@@ -426,6 +443,9 @@ x_session_initialize (dpyinfo)
426 SmcCallbacks callbacks; 443 SmcCallbacks callbacks;
427 int name_len = 0; 444 int name_len = 0;
428 445
446 ice_fd = -1;
447 doing_interact = False;
448
429 /* Check if we where started by the session manager. If so, we will 449 /* Check if we where started by the session manager. If so, we will
430 have a previous id. */ 450 have a previous id. */
431 if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) 451 if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id))
@@ -497,7 +517,7 @@ x_session_initialize (dpyinfo)
497void 517void
498x_session_close () 518x_session_close ()
499{ 519{
500 ice_fd = -1; 520 ice_connection_closed ();
501} 521}
502 522
503 523
diff --git a/src/xterm.c b/src/xterm.c
index 1add3c415e7..9ed98deb7b5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7446,6 +7446,11 @@ x_clear_frame_area (f, x, y, width, height)
7446{ 7446{
7447 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7447 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
7448 x, y, width, height, False); 7448 x, y, width, height, False);
7449#ifdef USE_GTK
7450 /* Must queue a redraw, because scroll bars might have been cleared. */
7451 if (FRAME_GTK_WIDGET (f))
7452 gtk_widget_queue_draw (FRAME_GTK_WIDGET (f));
7453#endif
7449} 7454}
7450 7455
7451 7456