aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog44
-rw-r--r--src/emacs.c19
-rw-r--r--src/gtkutil.c18
-rw-r--r--src/nsfont.m35
-rw-r--r--src/nsterm.m2
-rw-r--r--src/sysdep.c19
-rw-r--r--src/xterm.c43
7 files changed, 124 insertions, 56 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 13b53e922ed..9096b904171 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,43 @@
12013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
4 (nsfont_draw): Remove disabling of LCD smoothing.
5 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
6 Bug#11484 with LCD smoothing on.
7
82013-01-13 Paul Eggert <eggert@cs.ucla.edu>
9
10 Fix SIGDANGER handlers, for AIX (Bug#13408).
11 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
12 Move handlers here from emacs.c; they were out of place.
13
142013-01-11 Jan Djärv <jan.h.d@swipnet.se>
15
16 * xterm.c (syms_of_xterm): Adjust documentation for
17 scroll-bar-adjust-thumb-portion.
18
192012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
20
21 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
22 determine whether scroll bar thumb size should be adjusted or
23 not. Use variable for MOTIF.
24
25 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
26 GTK.
27
282013-01-13 Jan Djärv <jan.h.d@swipnet.se>
29
30 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
31 event is generated.
32 (doCommandBySelector:): Set processingCompose to NO.
33
34 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
35 Remove check for fkeys count > zero, block/unblock fixes the real bug.
36 (nsfont_list_family): Add block/unblock_input calls.
37 (nsfont_open): Move block_input earlier. Add unblock_input before early
38 return.
39 (nsfont_draw): Add block/unblock_input calls.
40
12013-01-12 Dmitry Antipov <dmantipov@yandex.ru> 412013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2 42
3 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs 43 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
@@ -46,7 +86,7 @@
46 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY. 86 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
47 This is the main part of the bug fix. 87 This is the main part of the bug fix.
48 88
492013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change) 892013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
50 90
51 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around 91 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
52 x_last_font_name (Bug#13403). 92 x_last_font_name (Bug#13403).
@@ -1758,7 +1798,7 @@
1758 * image.c (xpm_make_color_table_h): Fix compiler error because 1798 * image.c (xpm_make_color_table_h): Fix compiler error because
1759 make_hash_table changed. 1799 make_hash_table changed.
1760 1800
17612012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change) 18012012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1762 1802
1763 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541). 1803 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1764 1804
diff --git a/src/emacs.c b/src/emacs.c
index 3dad507f4d3..d1eeb97980a 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -347,25 +347,6 @@ terminate_due_to_signal (int sig, int backtrace_limit)
347 /* This shouldn't be executed, but it prevents a warning. */ 347 /* This shouldn't be executed, but it prevents a warning. */
348 exit (1); 348 exit (1);
349} 349}
350
351#ifdef SIGDANGER
352
353/* Handler for SIGDANGER. */
354static void
355handle_danger_signal (int sig)
356{
357 malloc_warning ("Operating system warns that virtual memory is running low.\n");
358
359 /* It might be unsafe to call do_auto_save now. */
360 force_auto_save_soon ();
361}
362
363static void
364deliver_danger_signal (int sig)
365{
366 deliver_process_signal (sig, handle_danger_signal);
367}
368#endif
369 350
370/* Code for dealing with Lisp access to the Unix command line. */ 351/* Code for dealing with Lisp access to the Unix command line. */
371 352
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6daf189f74c..af845f69e62 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3795,13 +3795,17 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3795 3795
3796 adj = gtk_range_get_adjustment (GTK_RANGE (wscroll)); 3796 adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
3797 3797
3798 /* We do the same as for MOTIF in xterm.c, assume 30 chars per line 3798 if (scroll_bar_adjust_thumb_portion_p)
3799 rather than the real portion value. This makes the thumb less likely 3799 {
3800 to resize and that looks better. */ 3800 /* We do the same as for MOTIF in xterm.c, use 30 chars per
3801 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; 3801 line rather than the real portion value. This makes the
3802 /* When the thumb is at the bottom, position == whole. 3802 thumb less likely to resize and that looks better. */
3803 So we need to increase `whole' to make space for the thumb. */ 3803 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
3804 whole += portion; 3804
3805 /* When the thumb is at the bottom, position == whole.
3806 So we need to increase `whole' to make space for the thumb. */
3807 whole += portion;
3808 }
3805 3809
3806 if (whole <= 0) 3810 if (whole <= 0)
3807 top = 0, shown = 1; 3811 top = 0, shown = 1;
diff --git a/src/nsfont.m b/src/nsfont.m
index c0bea2e225c..5039f0c9013 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -44,6 +44,7 @@ Author: Adrian Robert (arobert@cogsci.ucsd.edu)
44#endif 44#endif
45 45
46#define NSFONT_TRACE 0 46#define NSFONT_TRACE 0
47#define LCD_SMOOTHING_MARGIN 2
47 48
48extern Lisp_Object Qns; 49extern Lisp_Object Qns;
49extern Lisp_Object Qnormal, Qbold, Qitalic; 50extern Lisp_Object Qnormal, Qbold, Qitalic;
@@ -546,6 +547,7 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
546 NSSet *cFamilies; 547 NSSet *cFamilies;
547 BOOL foundItal = NO; 548 BOOL foundItal = NO;
548 549
550 block_input ();
549 if (NSFONT_TRACE) 551 if (NSFONT_TRACE)
550 { 552 {
551 fprintf (stderr, "nsfont: %s for fontspec:\n ", 553 fprintf (stderr, "nsfont: %s for fontspec:\n ",
@@ -560,10 +562,7 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
560 if (isMatch) 562 if (isMatch)
561 [fkeys removeObject: NSFontFamilyAttribute]; 563 [fkeys removeObject: NSFontFamilyAttribute];
562 564
563 if ([fkeys count] > 0) 565 matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
564 matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
565 else
566 matchingDescs = [NSMutableArray array];
567 566
568 if (NSFONT_TRACE) 567 if (NSFONT_TRACE)
569 NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, 568 NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc,
@@ -598,6 +597,8 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
598 [s1 release]; 597 [s1 release];
599 } 598 }
600 599
600 unblock_input ();
601
601 /* Return something if was a match and nothing found. */ 602 /* Return something if was a match and nothing found. */
602 if (isMatch) 603 if (isMatch)
603 return ns_fallback_entity (); 604 return ns_fallback_entity ();
@@ -701,10 +702,12 @@ static Lisp_Object
701nsfont_list_family (Lisp_Object frame) 702nsfont_list_family (Lisp_Object frame)
702{ 703{
703 Lisp_Object list = Qnil; 704 Lisp_Object list = Qnil;
704 NSEnumerator *families = 705 NSEnumerator *families;
705 [[[NSFontManager sharedFontManager] availableFontFamilies]
706 objectEnumerator];
707 NSString *family; 706 NSString *family;
707
708 block_input ();
709 families = [[[NSFontManager sharedFontManager] availableFontFamilies]
710 objectEnumerator];
708 while ((family = [families nextObject])) 711 while ((family = [families nextObject]))
709 list = Fcons (intern ([family UTF8String]), list); 712 list = Fcons (intern ([family UTF8String]), list);
710 /* FIXME: escape the name? */ 713 /* FIXME: escape the name? */
@@ -713,6 +716,7 @@ nsfont_list_family (Lisp_Object frame)
713 fprintf (stderr, "nsfont: list families returning %"pI"d entries\n", 716 fprintf (stderr, "nsfont: list families returning %"pI"d entries\n",
714 XINT (Flength (list))); 717 XINT (Flength (list)));
715 718
719 unblock_input ();
716 return list; 720 return list;
717} 721}
718 722
@@ -735,6 +739,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
735 Lisp_Object font_object; 739 Lisp_Object font_object;
736 int fixLeopardBug; 740 int fixLeopardBug;
737 741
742 block_input ();
743
738 if (NSFONT_TRACE) 744 if (NSFONT_TRACE)
739 { 745 {
740 fprintf (stderr, "nsfont: open size %d of fontentity:\n ", pixel_size); 746 fprintf (stderr, "nsfont: open size %d of fontentity:\n ", pixel_size);
@@ -794,13 +800,14 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
794 font_info = (struct nsfont_info *) XFONT_OBJECT (font_object); 800 font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
795 font = (struct font *) font_info; 801 font = (struct font *) font_info;
796 if (!font) 802 if (!font)
797 return Qnil; /* FIXME: other terms do, but return Qnil causes segfault */ 803 {
804 unblock_input ();
805 return Qnil; /* FIXME: other terms do, but return Qnil causes segfault */
806 }
798 807
799 font_info->glyphs = xzalloc (0x100 * sizeof *font_info->glyphs); 808 font_info->glyphs = xzalloc (0x100 * sizeof *font_info->glyphs);
800 font_info->metrics = xzalloc (0x100 * sizeof *font_info->metrics); 809 font_info->metrics = xzalloc (0x100 * sizeof *font_info->metrics);
801 810
802 block_input ();
803
804 /* for metrics */ 811 /* for metrics */
805#ifdef NS_IMPL_COCOA 812#ifdef NS_IMPL_COCOA
806 sfont = [nsfont screenFontWithRenderingMode: 813 sfont = [nsfont screenFontWithRenderingMode:
@@ -1051,6 +1058,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1051 char isComposite = s->first_glyph->type == COMPOSITE_GLYPH; 1058 char isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
1052 int end = isComposite ? s->cmp_to : s->nchars; 1059 int end = isComposite ? s->cmp_to : s->nchars;
1053 1060
1061 block_input ();
1054 /* Select face based on input flags */ 1062 /* Select face based on input flags */
1055 switch (ns_tmp_flags) 1063 switch (ns_tmp_flags)
1056 { 1064 {
@@ -1240,7 +1248,6 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1240 else 1248 else
1241 CGContextSetShouldAntialias (gcontext, 1); 1249 CGContextSetShouldAntialias (gcontext, 1);
1242 1250
1243 CGContextSetShouldSmoothFonts (gcontext, NO);
1244 CGContextSetTextMatrix (gcontext, fliptf); 1251 CGContextSetTextMatrix (gcontext, fliptf);
1245 1252
1246 if (bgCol != nil) 1253 if (bgCol != nil)
@@ -1273,6 +1280,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1273 /* Draw underline, overline, strike-through. */ 1280 /* Draw underline, overline, strike-through. */
1274 ns_draw_text_decoration (s, face, col, r.size.width, r.origin.x); 1281 ns_draw_text_decoration (s, face, col, r.size.width, r.origin.x);
1275 1282
1283 unblock_input ();
1276 return to-from; 1284 return to-from;
1277} 1285}
1278 1286
@@ -1406,11 +1414,12 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
1406 1414
1407 lb = r.origin.x; 1415 lb = r.origin.x;
1408 rb = r.size.width - w; 1416 rb = r.size.width - w;
1417 // Add to bearing for LCD smoothing. We don't know if it is there.
1409 if (lb < 0) 1418 if (lb < 0)
1410 metrics->lbearing = round (lb); 1419 metrics->lbearing = round (lb - LCD_SMOOTHING_MARGIN);
1411 if (font_info->ital) 1420 if (font_info->ital)
1412 rb += 0.22 * font_info->height; 1421 rb += 0.22 * font_info->height;
1413 metrics->rbearing = lrint (w + rb); 1422 metrics->rbearing = lrint (w + rb + LCD_SMOOTHING_MARGIN);
1414 1423
1415 metrics->descent = r.origin.y < 0 ? -r.origin.y : 0; 1424 metrics->descent = r.origin.y < 0 ? -r.origin.y : 0;
1416 /*lrint (hshrink * [sfont ascender] + expand * hd/2); */ 1425 /*lrint (hshrink * [sfont ascender] + expand * hd/2); */
diff --git a/src/nsterm.m b/src/nsterm.m
index 0fd062b7f17..48efac3f70b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4981,6 +4981,7 @@ not_in_argv (NSString *arg)
4981 4981
4982 emacs_event->code = code; 4982 emacs_event->code = code;
4983 EV_TRAILER (theEvent); 4983 EV_TRAILER (theEvent);
4984 processingCompose = NO;
4984 return; 4985 return;
4985 } 4986 }
4986 } 4987 }
@@ -5171,6 +5172,7 @@ not_in_argv (NSString *arg)
5171 if (NS_KEYLOG) 5172 if (NS_KEYLOG)
5172 NSLog (@"doCommandBySelector: %@", NSStringFromSelector (aSelector)); 5173 NSLog (@"doCommandBySelector: %@", NSStringFromSelector (aSelector));
5173 5174
5175 processingCompose = NO;
5174 if (aSelector == @selector (deleteBackward:)) 5176 if (aSelector == @selector (deleteBackward:))
5175 { 5177 {
5176 /* happens when user backspaces over an ongoing composition: 5178 /* happens when user backspaces over an ongoing composition:
diff --git a/src/sysdep.c b/src/sysdep.c
index 158d2f73eec..0e9a6826005 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1678,6 +1678,25 @@ deliver_arith_signal (int sig)
1678 deliver_thread_signal (sig, handle_arith_signal); 1678 deliver_thread_signal (sig, handle_arith_signal);
1679} 1679}
1680 1680
1681#ifdef SIGDANGER
1682
1683/* Handler for SIGDANGER. */
1684static void
1685handle_danger_signal (int sig)
1686{
1687 malloc_warning ("Operating system warns that virtual memory is running low.\n");
1688
1689 /* It might be unsafe to call do_auto_save now. */
1690 force_auto_save_soon ();
1691}
1692
1693static void
1694deliver_danger_signal (int sig)
1695{
1696 deliver_process_signal (sig, handle_danger_signal);
1697}
1698#endif
1699
1681/* Treat SIG as a terminating signal, unless it is already ignored and 1700/* Treat SIG as a terminating signal, unless it is already ignored and
1682 we are in --batch mode. Among other things, this makes nohup work. */ 1701 we are in --batch mode. Among other things, this makes nohup work. */
1683static void 1702static void
diff --git a/src/xterm.c b/src/xterm.c
index e24fbd19f2b..212530e5acf 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4811,21 +4811,24 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
4811 4811
4812#ifdef USE_MOTIF 4812#ifdef USE_MOTIF
4813 4813
4814 /* We use an estimate of 30 chars per line rather than the real 4814 if (scroll_bar_adjust_thumb_portion_p)
4815 `portion' value. This has the disadvantage that the thumb size 4815 {
4816 is not very representative, but it makes our life a lot easier. 4816 /* We use an estimate of 30 chars per line rather than the real
4817 Otherwise, we have to constantly adjust the thumb size, which 4817 `portion' value. This has the disadvantage that the thumb size
4818 we can't always do quickly enough: while dragging, the size of 4818 is not very representative, but it makes our life a lot easier.
4819 the thumb might prevent the user from dragging the thumb all the 4819 Otherwise, we have to constantly adjust the thumb size, which
4820 way to the end. but Motif and some versions of Xaw3d don't allow 4820 we can't always do quickly enough: while dragging, the size of
4821 updating the thumb size while dragging. Also, even if we can update 4821 the thumb might prevent the user from dragging the thumb all the
4822 its size, the update will often happen too late. 4822 way to the end. but Motif and some versions of Xaw3d don't allow
4823 If you don't believe it, check out revision 1.650 of xterm.c to see 4823 updating the thumb size while dragging. Also, even if we can update
4824 what hoops we were going through and the still poor behavior we got. */ 4824 its size, the update will often happen too late.
4825 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30; 4825 If you don't believe it, check out revision 1.650 of xterm.c to see
4826 /* When the thumb is at the bottom, position == whole. 4826 what hoops we were going through and the still poor behavior we got. */
4827 So we need to increase `whole' to make space for the thumb. */ 4827 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
4828 whole += portion; 4828 /* When the thumb is at the bottom, position == whole.
4829 So we need to increase `whole' to make space for the thumb. */
4830 whole += portion;
4831 }
4829 4832
4830 if (whole <= 0) 4833 if (whole <= 0)
4831 top = 0, shown = 1; 4834 top = 0, shown = 1;
@@ -10802,6 +10805,16 @@ With MS Windows or Nextstep, the value is t. */);
10802 Vx_toolkit_scroll_bars = Qnil; 10805 Vx_toolkit_scroll_bars = Qnil;
10803#endif 10806#endif
10804 10807
10808 DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion",
10809 scroll_bar_adjust_thumb_portion_p,
10810 doc: /* Adjust thumb for overscrolling for Gtk+ and MOTIF.
10811Non-nil means adjust the thumb in the scroll bar so it can be dragged downwards
10812even if the end of the buffer is shown (i.e. overscrolling).
10813Set to nil if you want the thumb to be at the bottom when the end of the buffer
10814is shown. Also, the thumb fills the whole scroll bar when the entire buffer
10815is visible. In this case you can not overscroll. */);
10816 scroll_bar_adjust_thumb_portion_p = 1;
10817
10805 staticpro (&last_mouse_motion_frame); 10818 staticpro (&last_mouse_motion_frame);
10806 last_mouse_motion_frame = Qnil; 10819 last_mouse_motion_frame = Qnil;
10807 10820