summaryrefslogtreecommitdiff
path: root/lwlib/xlwmenu.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix calculation of default highlightForeground in the lucid menu barPo Lu2022-07-201-36/+61
| | | | | | | | | * lwlib/xlwmenu.c (xlwMenuResources, display_menu_item) (make_drawing_gcs, make_shadow_gcs, openXftFont, XlwMenuRealize) (XlwMenuSetValues): Use -1 as the default for highlight_foreground. Replace that with the normal foreground when creating GCs. Reported by Colin Baxter <m43cap@yandex.com>.
* Colored menu highlight in Lucid backendManuel Giraud2022-07-161-104/+248
| | | | | | | | * lwlib/xlwmenuP.h: * lwlib/xlwmenu.h: * lwlib/xlwmenu.c: Introduce resources to handle colored highlighting of menu entries. * doc/emacs/xresources.texi (Lucid Resources): Documentation.
* ; * lwlib/xlwmenu.c (make_shadow_gcs): Remove "a = a" pattern.Manuel Giraud2022-07-111-4/+0
| | | | | * lwlib/xlwmenu.c (make_shadow_gcs): Remove code that sets a value to itself (bug#56479).
* Fix recent change to xlwmenu.cPo Lu2022-06-211-6/+16
| | | | | | | | | * lwlib/xlwmenu.c (ungrab_all): Ungrab keyboard if it was grabbed. This handles `lucid--menu-grab-keyboard' changing while the menu is open. (XlwMenuDestroy): (pop_up_menu): Record if the keyboard was grabbed.
* ; * lwlib/xlwmenu.c (ungrab_all): Fix typo.Eli Zaretskii2022-06-211-1/+1
|
* Make Lucid menus work from the keyboard also when uninstalledLars Ingebrigtsen2022-06-211-7/+3
| | | | | | * lwlib/xlwmenu.c (ungrab_all, pop_up_menu): Use it. * src/keyboard.c (syms_of_keyboard): New variable (bug#46990).
* Fix menu bar not opening after popup menu is dismissed on LucidPo Lu2022-02-081-1/+2
| | | | | * lwlib/xlwmenu.c (XlwMenuDestroy): Only set submenu_destroyed if menu bar widget.
* * lwlib/xlwmenu.c (pop_up_menu): Fix cast.Po Lu2022-02-071-1/+1
|
* * lwlib/xlwmenu.c (pop_up_menu): Work around motion problems on XI2.Po Lu2022-02-061-0/+2
|
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | * lwlib/xlwmenu.c (fit_to_screen): Adjust correctly for child menus.Po Lu2021-12-281-4/+12
| |
* | Fix menu placement on multiple-display setups when using lwlibPo Lu2021-12-281-23/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lwlib/xlwmenu.c (fit_to_screen): (pop_up_menu): Adjust menu position based on dimensions of the current monitor's workarea. (bug#52809) * src/xfns.c (x_get_monitor_attributes): Stop testing for the RandR extension here. (xlw_monitor_dimensions_at_pos_1): (xlw_monitor_dimensions_at_pos): New functions. * src/xterm.c (x_term_init): Query for the RandR extension when connecting to a display. * src/xterm.h (xlw_monitor_dimensions_at_pos): New prototype.
* | Re-enable the disabledForeground X resource.Gregory Heytings2021-11-241-1/+0
| | | | | | | | | | | | | | | | | | * doc/emacs/xresources.texi (Lucid Resources): Document the resource. Also document the 'cursor' resource (bug#52052). * lwlib/xlwmenu.c (make_drawing_gcs): Re-enable the use of the disabledForeground resource. The use of this X resource was disabled without reason in commit ef93458b2f8 by overwriting its value with the value of the foreground resource.
* | Implement the buttonForeground resourceGregory Heytings2021-11-201-0/+30
| | | | | | | | | | * lwlib/xlwmenu.c (draw_shadow_rectangle, draw_shadow_rhombus): Use the buttonForeground resource color (bug#51988).
* | New X resource to control the border thickness of menusGregory Heytings2021-11-161-1/+4
|/ | | | | | | | | | * lwlib/xlwmenu.h (XtNborderThickness, XtCBorderThickness): New X resource name. * lwlib/xlwmenuP.h (XlwMenuPart): New border_thickness field. * lwlib/xlwmenu.c (xlwMenuResources): Access the new resource. (draw_shadow_rectangle): Use the new resource value. * doc/emacs/xresources.texi (Lucid Resources): Document the new resource (bug#51867).
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Don't link libXft when using cairoYAMAMOTO Mitsuharu2019-04-241-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Check cairo early. Don't try Xft if cairo is used. * lwlib/lwlib-utils.h [USE_CAIRO]: Include cairo.h and fontconfig.h. (XftFont, XftDraw, XftColor, XGlyphInfo) [USE_CAIRO]: New typedefs. (XftFontOpenName, XftFontClose, XftDrawCreate, XftDrawDestroy) (XftDrawRect, XftDrawStringUtf8, XftTextExtentsUtf8) [USE_CAIRO]: New macros. (crxft_font_open_name, crxft_font_close, crxft_draw_create) (crxft_draw_rect, crxft_draw_string, crxft_text_extents) [USE_CAIRO]: New externs. * lwlib/lwlib-utils.c [USE_CAIRO]: Include math.h, cairo-ft.h, and cairo-xlib.h. (crxft_font_open_name, crxft_font_close, crxft_draw_create) (crxft_set_source_color, crxft_draw_rect, crxft_draw_string) (crxft_text_extents) [USE_CAIRO]: New Xft compatibility functions. * lwlib/xlwmenuP.h [USE_CAIRO]: Include lwlib-utils.h. * lwlib/xlwmenu.c (display_menu_item) [USE_CAIRO]: Call cairo_surface_mark_dirty and cairo_surface_flush. * lwlib/lwlib-Xaw.c [USE_CAIRO]: Include stdlib.h and lwlib-utils.h. (draw_text) [USE_CAIRO]: Call cairo_surface_flush. * src/xsettings.c [USE_CAIRO]: Include fontconfig.h (apply_xft_settings) [!HAVE_XFT]: Don't call XftDefaultSubstitute or XftDefaultSet. * lwlib/lwlib-Xaw.c: * lwlib/lwlib-int.h: * lwlib/xlwmenu.c: * lwlib/xlwmenuP.h: * src/xrdb.c: * src/xsettings.c: * src/xterm.c: Replace all #ifdef HAVE_XFT with #if defined USE_CAIRO || defined HAVE_XFT. * src/xfns.c (x_default_font_parameter): Replace #ifdef HAVE_XFT with #if defined USE_CAIRO || defined HAVE_XFT.
* Fix text metrics calculation in Xft support for lwlibYAMAMOTO Mitsuharu2019-04-211-1/+1
| | | | | * lwlib/lwlib-Xaw.c (get_text_width_and_height) [HAVE_XFT]: * lwlib/xlwmenu.c (string_width) [HAVE_XFT]: Use xOff member instead of width.
* Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Tweak X toolkit code to pacify modern GCCPaul Eggert2017-03-101-4/+4
| | | | | | | | | | | | | | | | | | | | * lwlib/lwlib-Xaw.c, lwlib/lwlib-Xm.c, lwlib/lwlib.c: Don’t include <stdlib.h>, since this code now calls emacs_abort rather than abort. * lwlib/lwlib-Xaw.c (make_dialog, xaw_generic_callback) (wm_delete_window): * lwlib/lwlib-Xm.c (make_menu_in_widget, do_call): * lwlib/lwlib.c (instantiate_widget_instance, lw_make_widget): * lwlib/xlwmenu.c (abort_gracefully, draw_separator) (separator_height, XlwMenuInitialize): Use emacs_abort, not abort. Without this change, some calls to ‘abort’ were invalid, as stdlib.h was not always included. * src/widget.c (resources, emacsFrameClassRec): * src/xfns.c (x_window) [USE_X_TOOLKIT]: * src/xmenu.c (create_and_show_popup_menu) [USE_X_TOOLKIT]: * src/xterm.c (emacs_options) [USE_X_TOOLKIT}: (x_term_init) [USE_X_TOOLKIT]: Cast string constants to char * to pacify --enable-gcc-warnings.
* Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | Run admin/update-copyright.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Remove SunOS 4.x cruftPaul Eggert2015-12-181-6/+0
| | | | | | Support for SunOS 4.x was removed in Emacs 23 but some cruft was left behind. * lib-src/pop.c [sun]: Remove no-longer-needed include. * lwlib/xlwmenu.c (SUNSO41): Remove.
* Assume C89 offsetof in xterm.c, xlwmenu.cPaul Eggert2015-04-141-1/+1
| | | | | | * lwlib/xlwmenu.c (offset): * src/xterm.c (cvt_string_to_pixel_args): Use offsetof, not XtOffset.
* Add classes as run-time descriptors of cl-structs.Stefan Monnier2015-03-181-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class): New function. (cl--make-slot-desc): New constructor. (cl--plist-remove, cl--struct-register-child): New functions. (cl-struct-define): Rewrite. (cl-structure-class, cl-structure-object, cl-slot-descriptor) (cl--class): New structs. (cl--struct-default-parent): Initialize it here. * lisp/emacs-lisp/cl-macs.el (cl--find-class): New macro. (cl-defsubst, cl--defsubst-expand, cl--sublis): Move before first use. (cl--struct-default-parent): New var. (cl-defstruct): Adjust to new representation of classes; add default parent. In accessors, signal `wrong-type-argument' rather than a generic error. (cl-struct-sequence-type, cl-struct-slot-info) (cl-struct-slot-offset): Rewrite. * lisp/emacs-lisp/cl-generic.el (cl--generic-struct-specializers) (cl-generic-generalizers): Rewrite. * src/alloc.c (purecopy): Handle hash-tables. * lisp/emacs-lisp/debug.el (debug--implement-debug-on-entry): Bind inhibit-debug-on-entry here... (debug): Instead of here. * lisp/emacs-lisp/macroexp.el (macroexp--debug-eager): New var. (internal-macroexpand-for-load): Use it. * lwlib/xlwmenu.c (pop_up_menu): Remove debugging code.
* * xlwmenu.c (remap_menubar): Re-realize menu to force move under Gnome 3.Jan D2015-02-281-5/+10
|
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer stpcpy to strcatPaul Eggert2014-12-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/merge-gnulib (GNULIB_MODULES): Add stpcpy. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/stpcpy.c, m4/stpcpy.m4: New files, from gnulib. * lib-src/ebrowse.c (sym_scope_1, operator_name, open_file): * lib-src/emacsclient.c (get_server_config, set_local_socket) (start_daemon_and_retry_set_socket): * lib-src/etags.c (main, C_entries, relative_filename): * lib-src/pop.c (sendline): * lib-src/update-game-score.c (main): * lwlib/xlwmenu.c (resource_widget_value): * src/callproc.c (child_setup): * src/dbusbind.c (xd_signature_cat): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fuser_full_name): * src/frame.c (xrdb_get_resource): * src/gtkutil.c (xg_get_file_with_chooser): * src/tparam.c (tparam1): * src/xfns.c (xic_create_fontsetname): * src/xrdb.c (gethomedir, get_user_db, get_environ_db): * src/xsmfns.c (smc_save_yourself_CB): Rewrite to avoid the need for strcat, typically by using stpcpy and/or lispstpcpy. strcat tends to be part of O(N**2) algorithms. * src/doc.c (sibling_etc): * src/xrdb.c (xdefaults): Now a top-level static constant.
* * xlwmenu.c (openXftFont): Do not load regular X font here.Dmitry Antipov2014-06-031-27/+11
| | | | | (XlwMenuInitialize): Remove ancient #if 0 code. (XlwMenuDestroy): Likewise. Free regular X font here.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
|
* Use URLs, not Boston addresses, in copyright notices.Paul Eggert2012-12-311-3/+1
|
* Use ASCII tests for character types.Paul Eggert2012-08-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/merge-gnulib (GNULIB_MODULES): Add c-ctype. * lwlib/lwlib-Xaw.c, lwlib/lwlib.c, lwlib/xlwmenu.c: Don't include <ctype.h>; no longer needed. * lwlib/lwlib-Xaw.c (openFont): * lwlib/xlwmenu.c (openXftFont): Test just for ASCII digits. * src/category.c, src/dispnew.c, src/doprnt.c, src/editfns.c, src/syntax.c * src/term.c, src/xfns.c, src/xterm.c: Don't include <ctype.h>; was not needed. * src/charset.c, src/doc.c, src/fileio.c, src/font.c, src/frame.c: * src/gtkutil.c, src/image.c, src/sysdep.c, src/xfaces.c: Include <c-ctype.h> instead of <ctype.h>. * src/nsterm.m: Include <c-ctype.h>. * src/charset.c (read_hex): * src/doc.c (Fsnarf_documentation): * src/fileio.c (IS_DRIVE) [WINDOWSNT]: (DRIVE_LETTER) [DOS_NT]: (Ffile_name_directory, Fexpand_file_name) (Fsubstitute_in_file_name): * src/font.c (font_parse_xlfd, font_parse_fcname): * src/frame.c (x_set_font_backend): * src/gtkutil.c (xg_get_font): * src/image.c (xbm_scan, xpm_scan, pbm_scan_number): * src/nsimage.m (hexchar): * src/nsterm.m (ns_xlfd_to_fontname): * src/sysdep.c (system_process_attributes): * src/xfaces.c (hash_string_case_insensitive): Use C-locale tests instead of locale-specific tests for character types, since we want the ASCII interpretation here, not the interpretation suitable for whatever happens to be the current locale.
* Clean out last vestiges of the old HAVE_CONFIG_H stuff.Paul Eggert2012-06-251-2/+0
|
* Switch from NO_RETURN to C11's _Noreturn.Paul Eggert2012-06-241-2/+1
| | | | Fixes: debbugs:11750
* Remove obsolete '#define static' cruft.Paul Eggert2012-05-301-13/+3
| | | | | | | | | | | | | | * etc/PROBLEMS: Remove obsolete '#define static' cruft. * lwlib/xlwmenu.c [emacs]: Include "bitmaps/gray.xbm". (gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits) [!emacs]: Remove; all uses replaced with definiens. * src/s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef. This #undef was "temporary" in 2000; it is no longer needed now that '#define static' has gone away. * src/xfns.c, src/xterm.h (gray_bitmap_width, gray_bitmap_height) (gray_bitmap_bits): Remove; no longer needed. All uses replaced with definiens. * src/xterm.c: Include "bitmaps/gray.xbm".
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* Spelling fixes.Paul Eggert2011-11-181-1/+1
|
* Use xfree, not free, to avoid crash with --enable-checking=xmallocoverrun.Dmitry Antipov2011-10-131-1/+1
|
* * xlwmenu.c (MINL): Define only if not emacs.Paul Eggert2011-04-151-0/+2
|
* * xlwmenu.c (XlwMenuSetValues): Rename/ move locals to avoid shadowing.Paul Eggert2011-04-151-18/+18
|
* Use *font for Xft font names for Lucid menus and dialogs.Jan Djärv2011-02-141-38/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/xresources.texi (X Resources): Remove *faceName and replace it with *font for Lucid. * lwlib/lwlib-Xaw.c (make_dialog): Use *font even for Xft fonts. Try XLoadQueryFont first and then Xft fonts. * lwlib/xlwmenu.c (xlwmenu_default_font): Remove, does not work for multi-display. (xlwMenuResources): Remove XtNfaceName and XtNdefaultFace. Make XtNFont a String resource. (make_windows_if_needed): Call XFlush so later changes are seen by the X server. (remap_menubar): Use XtMoveWidget and then XtResizeWidget/XtResizeWindow after XtPopup. Works better with Compiz. (make_drawing_gcs): Check if mw->menu.font is set. (getDefaultXftFont): New function. (openXftFont): faceName is now fontName. Try XLoadQueryFont first and then XftFontOpenName. (XlwMenuInitialize): Initialize mw->menu.font with XLoadQueryFont. (XlwMenuClassInitialize): Remove initialization of xlwmenu_default_font. (fontname_changed): Renamed from facename_changed. (XlwMenuSetValues): Use facename_changed. * lwlib/xlwmenu.h: Remove Xt[CN]faceName and Xt[NC]defaultFace. * lwlib/xlwmenuP.h (_XlwMenu_part): Remove faceName. Add fontName. * src/xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font. (apply_systemfont_to_menu): Set resources *menubar*font and *popup*font. Remove defflt. (set_frame_menubar, create_and_show_popup_menu): Call apply_systemfont_to_menu before lw_create_widget. * src/xrdb.c (x_load_resources): For LUCID and XFT, don't put a resource that specifies helvetica for menus and dialogs.
* lwlib/ trivia.Glenn Morris2011-02-091-3/+3
| | | | | * lwlib-Xaw.c, lwlib-Xlw.c, lwlib-Xm.c, lwlib-utils.c, lwlib.c, xlwmenu.c: Standardize on <> for includes from the ../src directory.
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|
* Nuke arch-tags.Glenn Morris2011-01-151-2/+0
|