Commit Graph

6062 Commits

Author SHA1 Message Date
ManoloFLTK
4ae905cc9d Change prototype of virtual Fl_Graphics_Driver::pango_font_description(). 2022-07-20 08:37:21 +02:00
ManoloFLTK
536c32ee99 Fl_Cairo_Graphics_Driver: simpler way to construct the PangoLayout object. 2022-07-18 22:58:02 +02:00
Albrecht Schlosser
3560ff450f Remove empty line 2022-07-16 16:52:26 +02:00
Leon Winter
9d27ec8754 beep: use maximum loudness for error, otherwise system-default 2022-07-16 16:52:26 +02:00
Leon Winter
3dd8c314d6 Let beep use system default settings
Please note that the parameter 'percent' of XBell(3).
Given the value of 100, the system defined setting
(normally specified via xset) is ignored and the
percent of 100 is used instead. When calling the
bell from fltk with FL_BEEP_DEFAULT I would expect
to get the default (system specified) percent setting.
2022-07-16 16:52:26 +02:00
ManoloFLTK
2327ede74c Add explanatory comments about text handling by Fl_Cairo_Graphics_Driver. 2022-07-11 12:11:04 +02:00
Albrecht Schlosser
79ce6547ce Fix non-xft build referencing fl_get_font_xfld() (#461)
This is only one part of issue 461 which describes two build errors
on "Raspberry Pi4 bullseye". It turned out that the build didn't
find Xft.
2022-07-09 22:05:46 +02:00
ManoloFLTK
f097141662 Move member q_width from class Fl_Font_Descriptor to Fl_Quartz_Font_Descriptor.
That's because this member is used only in Fl_Quartz_Font_Descriptor.
2022-07-06 10:18:40 +02:00
ManoloFLTK
c6659c9a29 Fl_Cairo_Graphics_Driver: fix issues in string width computations when scaling applies.
The implemented approach is to create and use the pango_layout_ object only relatively
to an unscaled cairo context. With this, the pixel width of a drawn string equals
the sum of the widths of its characters.
2022-07-06 10:05:00 +02:00
Albrecht Schlosser
3c6b34bb70 Fix a potential memory leak, see issue #457 2022-07-05 18:49:15 +02:00
ManoloFLTK
d096ec48d0 Documentation: add missing mentions of the Wayland platform. 2022-07-05 10:13:31 +02:00
ManoloFLTK
844d3d6d5c Wayland platform.: complete support of gl_start/gl_finish. 2022-07-04 11:44:03 +02:00
ManoloFLTK
8a2559e1af Wayland platform: add missing initialisation to Fl_Wayland_Gl_Window_Driver::gl_start(). 2022-07-02 17:41:45 +02:00
ManoloFLTK
16ecd6b821 Wayland platform: more accurate initial state of window buffer. 2022-07-02 16:44:17 +02:00
ManoloFLTK
c7493496c9 Wayland platform: add support of FL_ALPHA for GL windows. 2022-07-02 16:43:27 +02:00
Albrecht Schlosser
ef72df0dc7 Improve X11 selection data transfer (INCR) protocol (#451)
This improves reading large selections and fixes one more bug.

- Fix reading selection data size of clients that don't send the size.
  These clients don't respect the ICCCM. Using a default size instead.

- Improve memory allocation by pre-allocating at least 4 MB and
  extending by 4 MB to reduce the number of realloc() operations.
  This may waste up to 4 MB buffer space but this is only an issue
  if clients don't send an appropriate size (see above).

- Limit the initial allocation to 200 MB in case clients send higher
  values. This is very unlikely and might be a bug in these clients.
  Default extension as above would apply anyway.

- Add more comments and optional debug statements (commented out).

Note: reading selections (clipboard) from other clients using the
  INCR protocol is implemented but the opposite (providing large
  selections (clipboard) by using the INCR protocol is not.
2022-07-02 15:44:46 +02:00
Albrecht Schlosser
c555629162 Fix "Segfault if using very large selections" (issue #451)
- Fix reading the size (aka "lower bound") of selection data.

- Use Fl::fatal() to terminate the process if memory for the selection
  (aka clipboard) data can't be allocated. This should rarely
  happen but if it does this is at least a "clean" exit and does
  not overwrite arbitrary data waiting for later errors that are
  hard to debug (as the old code would have done).

  Todo: find a better solution because this can be caused by
  another faulty process (the "selection owner"). It would be good
  if we could ignore the transfer rather than killing the process.

- Continue processing the INCR protocol if another "unexpected" event
  is received. Such events can definitely happen but the current code
  can't deal with this because other events might cause recursions.
  Hence such events are currently ignored.

  Example: pressing and holding ctrl/v would trigger another clipboard
  transfer while we're still processing one.

Todo: maybe process "other" events correctly while processing the INCR
  protocol. The current processing is done inside a function and would
  need to call fl_handle() with potential recursions, hence this would
  likely need major refactoring.
2022-07-01 17:39:41 +02:00
Albrecht Schlosser
42c27da735 Reformat, remove unnecessary code, add comments 2022-07-01 17:39:41 +02:00
ManoloFLTK
50d26b09a8 Wayland platform: add support of gl_start() / gl_finish(). 2022-07-01 09:10:32 +02:00
Michael Tolly
65e5cd27cc kdialog native picker: properly handle spaces in filenames
Asks kdialog to use newlines for multiple files instead
2022-06-29 18:49:51 +02:00
ManoloFLTK
47f0d63f19 Wayland platform: send FL_ENTER/LEAVE/MOVE events to top-level windows only. 2022-06-29 18:02:11 +02:00
ManoloFLTK
a025a46cac Wayland platform: add support of FL_LEAVE event. 2022-06-28 18:47:15 +02:00
ManoloFLTK
8dd7ab1922 Fix for issue #450 : Fl_Counter slips into infinite loop (V2).
Need to poll only for the file descriptor associated to the wayland display.
2022-06-27 19:40:08 +02:00
ManoloFLTK
c2185f31b9 Remove unused code controlled by the FLTK_CONSOLIDATE_MOTION preprocessor variable. 2022-06-27 14:55:40 +02:00
ManoloFLTK
2a5c2322f1 Fix for issue #454 : crash in Fl::get_font_name(). 2022-06-27 13:25:35 +02:00
ZJUGKC
2f52b54a08
Fix unicode support in scandir_win32.c by using GetFileAttributesW (#455)
* Fix unicode support in scandir_win32.c by using GetFileAttributesW

* Remove the useless comments in scandir_win32.c
2022-06-25 20:53:19 +02:00
ManoloFLTK
feb0d918fb Remove arbitrary maximum length of font name. 2022-06-25 20:00:17 +02:00
ManoloFLTK
fb7469c85c Fix for issue #452: Fl::get_font_name failure on OS-X. 2022-06-24 19:50:47 +02:00
ManoloFLTK
617dc2ce12 Fix for issue #450: Fl_Counter slips into infinite loop.
This issue revealed that the macOS and Wayland platform processed events slightly differently
from other platforms.
Under X11 and Windows, Fl::wait() processes one event if one is present, and also all other events
present in the event queue immediately after the processing of that event.
Under macOS and Wayland, Fl::wait() processes one event if one is present and returns.

This commits makes the macOS and Wayland platforms behave as other platforms.
2022-06-23 19:12:35 +02:00
ManoloFLTK
e698af035a Fix issue #427 - 2nd part
Fix Fl_Tiled_Image made from scaled source image.
Fix Fl_Shared_Image::update() to allow scaled source image.
Correct handling of default value (-1) of 3rd argument of 3-argument Fl_BMP_Image constructor.
2022-06-20 12:49:38 +02:00
ManoloFLTK
02870242ee Move input method support to Fl_Screen_Driver from Fl_Graphics_Driver 2022-06-19 10:23:24 +02:00
Albrecht Schlosser
232743c3a5 Fix Fl_Counter event handling (#450, part 2)
This fixes some issues of the repeat timeout of Fl_Counter. It could
happen that the widget missed the FL_RELEASE event, for instance if
a modal window like fl_message() was opened in the callback but there
could be other reasons as well. See issue #450 for more info.
2022-06-17 17:16:59 +02:00
Albrecht Schlosser
f3bf231cc0 Improve reliability of timeout handling (#450, part 1)
This commit prevents "timer loops" without intermediate event handling
if callback handling takes longer than the timer delay of repeating
timers.

For more details see GitHub issue #450.
2022-06-17 17:05:10 +02:00
ManoloFLTK
d8eb1f9ca4 Minor simplification of Fl_Wayland_Graphics_Driver::cairo_init. 2022-06-13 16:37:25 +02:00
ManoloFLTK
394298aff4 Add explanatory comment about WL_SHM_FORMAT_ARGB8888 and CAIRO_FORMAT_ARGB32. 2022-06-13 16:19:43 +02:00
ManoloFLTK
2fc2c5b562 Fix support of transparent windows by wayland platform. 2022-06-13 10:41:24 +02:00
MatthiasWM
1b1e8a4d46 Issue #141: fl_filename_absolute bugs fixed for MSWindows. 2022-06-12 14:53:06 +02:00
Matthias Melcher
995e3118a6 Local isdirsep() must not be visible to the outside. 2022-06-12 14:14:23 +02:00
Matthias Melcher
e6ca751e92 Issue #142: fl_filename_absolute correctly handles trailing "..". 2022-06-12 14:07:16 +02:00
ManoloFLTK
c6516673ee New member Fl_Cairo_Graphics_Driver::bitmap_to_pattern() to avoid code duplication. 2022-06-12 09:04:22 +02:00
ManoloFLTK
78ca44ccca Fix Fl_Wayland_Window_Driver::shape_bitmap_(Fl_Image*). 2022-06-11 15:19:37 +02:00
Matthias Melcher
79be9fb792 Reverting previous fix.
It introduced a new issue. Sorry!
2022-06-11 12:36:59 +02:00
Matthias Melcher
9c89a7f320 Handling trailing ".." in fl_filename_absolute. 2022-06-11 12:34:47 +02:00
Matthias Melcher
bcbdf5546f Some docs for printing asynchronously. 2022-06-11 11:57:15 +02:00
ManoloFLTK
23d0a631cf Remove useless code from Fl_Wayland_Window_Driver::{un}map()
That code was useless because map() and unmap() get only called for subwindows.
2022-06-11 09:36:16 +02:00
ManoloFLTK
6add57d4bd Wayland under FreeBSD: use package evdev-proto which brings linux/input.h 2022-06-06 15:32:54 +02:00
ManoloFLTK
a7de80d6f7 Fix for issue #447: dotted focus rectangles are a little "ragged" with some scales. 2022-06-04 11:44:21 +02:00
ManoloFLTK
b78035624d Fl_Cairo_Graphics_Driver: fix GUI rescaling.
The solution to avoid blurred graphics when the GUI is scaled is to turn off
cairo antialiasing when drawing horizontal and vertical lines and rectangles.
2022-05-27 08:58:35 +02:00
ManoloFLTK
7fcd4b73d7 Wayland platform: more accurate procedure to map a GL (sub)window. 2022-05-25 18:37:43 +02:00
ManoloFLTK
a118732f7c Improve rectf() and push_clip() under cairo and GUI scaling. 2022-05-25 16:05:36 +02:00
ManoloFLTK
6c6a80b90e Add detailed explanations in Fl_Wayland_Gl_Window_Driver::make_current_before() 2022-05-24 11:07:04 +02:00
ManoloFLTK
d971f6f59f Simpler, compositor-independent procedure to map GL window under Wayland. 2022-05-23 19:45:12 +02:00
Albrecht Schlosser
40569e53c7 Fix MinGW build with shared libs (#445)
Add missing lib 'gdiplus' to shared libs.
2022-05-22 00:07:40 +02:00
ManoloFLTK
ad96df9e93 Wayland under FreeBSD: detect <GL/glu.h> and fix LIBDECOR_PLUGIN_DIR. 2022-05-21 07:55:03 +02:00
ManoloFLTK
de91a92e67 Wayland under FreeBSD: add support for CMake-based builds. 2022-05-20 17:46:05 +02:00
ManoloFLTK
9c9ce66d05 Wayland under FreeBSD: fix support of GL windows. 2022-05-20 15:22:28 +02:00
ManoloFLTK
1c37c29e2d Avoid "hides overloaded function" warning messages. 2022-05-19 10:28:39 +02:00
ManoloFLTK
905a90f660 Make Fl_Wayland_Screen_Driver::close_display() close the GL connection if any. 2022-05-17 12:11:18 +02:00
ManoloFLTK
f01216f167 Weston support: handle click on titlebar. 2022-05-17 10:40:09 +02:00
ManoloFLTK
b2bd12ae5e Fix Fl_Wayland_Window_Driver::wait_for_expose() - still WIP. 2022-05-16 19:22:57 +02:00
ManoloFLTK
2c52ebe210 Improve Fl_Wayland_Window_Driver::wait_for_expose(). 2022-05-16 16:34:59 +02:00
ManoloFLTK
5747c3eed9 Fix Fl_Wayland_Window_Driver::take_focus() required for recent Wayland versions. 2022-05-16 11:25:28 +02:00
ManoloFLTK
6efdcb1e6f Simpler code to map GL windows under Wayland. 2022-05-15 09:04:47 +02:00
ManoloFLTK
b6dae138d4 Restore top-level GL window under Weston. 2022-05-14 17:21:25 +02:00
ManoloFLTK
7fe6f4cf1d Have FLTK follow the Wayland surface holding keyboard focus. 2022-05-13 09:13:11 +02:00
ManoloFLTK
879f5f0770 Slightly simplify Fl_Wayland_Window_Driver::use_border(). 2022-05-10 17:26:37 +02:00
ManoloFLTK
9d054a169b Remove typos. 2022-05-10 17:00:32 +02:00
ManoloFLTK
a638d90e00 Add missing closing parenthesis. 2022-05-10 16:56:25 +02:00
ManoloFLTK
b6e0122926 Fix for issue #441: Some minor regressions with borderless+fullscreen (Wayland). 2022-05-10 16:52:46 +02:00
ManoloFLTK
ad27da578a Avoid glpuzzle crash when resizing while puzzle is spinning - cont'd. 2022-05-09 19:56:17 +02:00
ManoloFLTK
48ca0e3b50 Avoid glpuzzle crash when resizing while puzzle is spinning. 2022-05-09 14:07:02 +02:00
ManoloFLTK
20c50312fc Cleaner declaration of public function fl_wl_cairo(). 2022-05-09 09:41:50 +02:00
ManoloFLTK
c02fba6bb9 Slight simplification of Fl_Wayland_Graphics_Driver::create_shm_buffer(). 2022-05-07 18:08:07 +02:00
ManoloFLTK
1d64b78554 Change protection levels in classes Fl_XXX_Gl_Window_Driver 2022-05-07 15:16:29 +02:00
ManoloFLTK
d4472e5e53 Remove useless typedef declaration. 2022-05-06 09:52:52 +02:00
ManoloFLTK
217120c281 Move struct shape_data_type inside Fl_XXX_Window_Driver. 2022-05-05 18:57:07 +02:00
ManoloFLTK
170a9d8e1f Approximate result of pango_font_metrics_get_height() for Pango < 1.44 2022-05-05 12:20:24 +02:00
ManoloFLTK
af91083a7f Fl_Cairo_Graphics_Driver: simpler code with early calls to cairo_surface_destroy().
Add also replacement for pango_font_metrics_get_height() which requires Pango 1.44
2022-05-05 11:34:10 +02:00
ManoloFLTK
e02ee7d5f1 Add check against null pointer occurrence reported with Gmsh (Issue #434). 2022-05-05 10:21:50 +02:00
ManoloFLTK
7d5d2af547 Cairo: reduce vertical offset for text position needed by Fl_Text_Display. 2022-05-04 08:28:12 +02:00
ManoloFLTK
a6e2940792 Remove one-pixel top and left borders of shaped windows. 2022-05-03 11:49:38 +02:00
ManoloFLTK
9082c44cd0 Issue #438 : Wayland: Text drawing different from Xft version - cont'd. 2022-05-02 19:40:43 +02:00
ManoloFLTK
049cef17f7 Set line height as computed by Pango. 2022-05-02 12:41:20 +02:00
ManoloFLTK
85cf597765 Keep the PangoLayout member private in class Fl_Cairo_Graphics_Driver. 2022-05-02 11:05:23 +02:00
ManoloFLTK
71dedbc886 Issue #438 : Wayland: Text drawing different from Xft version - cont'd. 2022-05-01 09:44:20 +02:00
ManoloFLTK
cf1c8b1125 Fix for issue #438 : Wayland: Text drawing different from Xft version - cont'd. 2022-04-30 16:37:28 +02:00
ManoloFLTK
5341f0e45e Add explanatory comments about text size and vertical position. 2022-04-29 16:34:47 +02:00
ManoloFLTK
1b513d3f00 Fix for issue #438 : Wayland: Textdrawing different from Xft version. 2022-04-29 13:10:40 +02:00
ManoloFLTK
a8da590d11 Fix for issue #434 : Segfaults on macOS. 2022-04-29 09:38:27 +02:00
ManoloFLTK
4618fa9053 Create member function Fl_Cairo_Graphics_Driver::set_cairo()- cont'd. 2022-04-25 10:29:57 +02:00
ManoloFLTK
8808d11578 Create member function Fl_Cairo_Graphics_Driver::set_cairo(). 2022-04-25 10:22:23 +02:00
ManoloFLTK
285e8e843a Create Fl_Cairo_Graphics_Driver::handle_dummy_cairo(cairo_t *cr). 2022-04-23 16:15:05 +02:00
ManoloFLTK
8e21120f75 Restore use of CMake OPTION_USE_SYSTEM_LIBDECOR 2022-04-22 08:00:00 +02:00
ManoloFLTK
9367bb5108 Avoid code duplication using os_create_anonymous_file() from libdecor. 2022-04-21 07:38:51 +02:00
ManoloFLTK
24885b3810 Minor improvement of get_prog_name(). 2022-04-21 07:06:18 +02:00
Albrecht Schlosser
804c48515d Improve docs of Fl_Image and related classes (#431)
Clarifications as discussed since April 15, 2022 07:00 UTC (see GitHub
issue #431).
2022-04-20 17:26:33 +02:00
ManoloFLTK
c1d0783df9 Document how to set window icons under Wayland - cont'd. 2022-04-15 11:05:19 +02:00
ManoloFLTK
827f91110b Remove unimplemented window icon-related member functions and variables.
Wayland uses .desktop files to set window icons.
2022-04-15 08:31:32 +02:00
Albrecht Schlosser
8bcfb88679 Fix documentation typo
Fix missing opening quote. (#431 cont'd)
2022-04-15 02:16:06 +02:00
Albrecht Schlosser
114dbc9c81 Clarify documentation of Fl_Image::copy() and more (#431)
- emphasize that Fl_Image::copy(W, H) creates an image with
  w() == data_w() == W and h() == data_h() == H
- clarify some more docs of Fl_Image methods (ensure that data_w()
  and data_h() are used where appropriate rather than w() and h()
- improve wording, examples, and formatting of related docs.

Closes #431
2022-04-15 02:01:33 +02:00