summaryrefslogtreecommitdiff
path: root/src/Fl_x.cxx
AgeCommit message (Collapse)Author
2022-09-12Allow use of Fl_Window::default_icon() with a scaled image.ManoloFLTK
2022-09-02Fix compiler warning [-Wunused-function]Albrecht Schlosser
warning: ‘int xrender_supported()’ defined but not used This happens only with certain configure options, particularly if FLTK_USE_CAIRO is set, i.e. drawing with Cairo is enabled.
2022-09-01Simplify Fl_Window_Driver::screen_num() member functions.ManoloFLTK
2022-08-29X11: Fix rescaling of non-resizable window (issue #491)Albrecht Schlosser
2022-08-29Make hybrid Wayland/X11 platform.ManoloFLTK
2022-07-27Fix for issue #471: Different Fl_Window::resize() behavior between v1.3.8 ↵ManoloFLTK
and v1.4
2022-07-02Improve X11 selection data transfer (INCR) protocol (#451)Albrecht Schlosser
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-01Fix "Segfault if using very large selections" (issue #451)Albrecht Schlosser
- 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-01Reformat, remove unnecessary code, add commentsAlbrecht Schlosser
2022-06-19Move input method support to Fl_Screen_Driver from Fl_Graphics_DriverManoloFLTK
2022-03-21Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing.ManoloFLTK
2022-03-21Fix for issue #418 : some warnings about unused functions.ManoloFLTK
2022-03-05Fix size_range() - continued (issue #392)Albrecht Schlosser
- fix window size of GL windows as reported for test/glpuzzle.cxx - fix window not resizing on ctrl/+/- (X11 only) Unfortunately the previous commit "optimized" a necessary X11 message away. This is now fixed. Fixes #392.
2022-03-04Add the Wayland platform to FLTK 1.4ManoloFLTK
2022-03-01Fix default size_range() calculation (issue #392, STR 3352)Albrecht Schlosser
2022-02-22X11: Disable "boxcheat" hackAlbrecht Schlosser
For details see comment in src/Fl_x.cxx: this "Hack to speed up bg box drawing" is now disabled for several reasons. The code is still available if the macro ENABLE_BOXCHEAT is defined.
2022-02-21Remove obsolete/disabled "boxcheat" codeAlbrecht Schlosser
Windows platform: Remove comments about obsolete code and one exported declaration of the variable 'fl_background_pixel' which is used only on the X11 platform. X11 platform: Remove comments. Other platforms: not affected.
2022-02-03Rearrange "Print Button Window" functionsAlbrecht Schlosser
- Rename Fl_Screen_Driver::print_or_copy_window() to fl_print_or_copy_window() - Add header file src/print_button.h - Update dependencies
2022-02-03Reorganize classes Fl_System_Driver and Fl_Screen_DriverManoloFLTK
These virtual members are moved from Fl_Screen_Driver to Fl_System_Driver - wait(double) - ready() These virtual members are moved from Fl_System_Driver to Fl_Screen_Driver - copy(const char *stuff, int len, int clipboard, const char *type) - void paste(Fl_Widget &widget, int clipboard, const char *type) - clipboard_contains(const char *type) - clipboard_notify_change() These members are moved from Fl_X11_Screen_Driver to Fl_X11_System_Driver - poll_or_select_with_delay(double time_to_wait) - poll_or_select() and are made virtual in preparation for the introduction of class Fl_Unix_System_Driver.
2022-01-08Input Method support: have the auxiliary window follow when the focus window ↵ManoloFLTK
is moved.
2022-01-07Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 ↵ManoloFLTK
platform.
2021-12-05Fixes STR #3352: "tiny window problem if child group larger than window"Greg Ercolano
2021-11-26Fix for issue #253: Remove xdbe supportManoloFLTK
2021-11-19Refactor and improve "Print front window" dialogAlbrecht Schlosser
src/print_button.cxx: "Print front window" implementation (new file) This is compiled and activated if USE_PRINT_BUTTON is defined. The feature can be fine controlled by environment variable 'FLTK_PRINT_BUTTON' (see docs in source file).
2021-11-05Fix X11 build with FLTK_CONSOLIDATE_MOTION turned offAlbrecht Schlosser
2021-11-05Make "FLTK_CONSOLIDATE_MOTION" user-definable (issue #76)Albrecht Schlosser
This undocumented macro is used on X11 and macOS platforms to consolidate mouse move events, i.e. to collect some events and send them later as one event. The old macro name CONSOLIDATE_MOTION has been renamed to FLTK_CONSOLIDATE_MOTION since it is now a "global" symbol. Users can define FLTK_CONSOLIDATE_MOTION in their build system, e.g. on the compiler commandline, as 0 or 1 to disable or enable this feature, respectively. In FLTK 1.3 the default was 0 (OFF) on macOS and 1 (ON) on X11. In FLTK 1.4 the default is always 0 (OFF).
2021-04-26Avoid "Bogus FL_MOVE/FL_DRAG events" (#76)Albrecht Schlosser
Fix sending bogus events if CONSOLIDATE_MOTION is on.
2021-03-31Move probe_for_GTK() to class Fl_Posix_System_Driver from Fl_X11_System_Driver.ManoloFLTK
Similarly move dlopen_or_dlsym(). This move is because GTK is not X11-specific.
2021-02-11Fix X11 copy-paste and drag-and-drop target selection (#182)Albrecht Schlosser
Select the "best" target rather than a random one out of a list of suitable targets. The old target selection algorithm would sometimes select the wrong target and hence retrieve unexpected data. This could happen in both copy-paste and drag-and-drop operations. Note: backported to 1.3.6 (git current) as well (commit 7ce6d2cf5dfc0488ec30d9f9f1709be73353479c). Closes #182.
2020-11-25Fix for issue #123 - X11 platformManoloFLTK
As discussed, only the window position becomes rounded to nearest integer value when a fractional GUI scale factor is applied.
2020-11-22Fix for STR #3424 and for issue #160ManoloFLTK
2020-10-28Remove the "Print" window meant for debugging.ManoloFLTK
2020-10-28Pango ps (#148)ManoloFLTK
Use cairo-PostScript to output PostScript when pango is available. This allows to draw in vectorial form any script. Before, only the Latin script could be drawn to PostScript in vectorial form.
2020-10-04Create Fl_X11_System_Driver::dlopen_or_dlsym() for run-time addresses.ManoloFLTK
The intent is to gather in a single place of the X11 platform source code all variable elements when using dlopen() and dlsym() system functions (e.g., .so vs .dylib extension name, is RTLD_DEFAULT available, locations to be sought). Member function Fl_System_Driver::load() is created only to support Fl_Plugin_Manager::load().
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
2020-06-24Fix static code analyzer warningsAlbrecht Schlosser
Note: there's more to do ...
2020-05-08Replace Fl_Window_Driver::is_a_rescale() by Fl_Window::is_a_rescale()ManoloFLTK
so it can be called by any user code.
2020-02-10X11: Fix X Input Methods (XIM) (STR 3502, 3192)Albrecht Schlosser
Revert commit 958d912ffcdb using 'XSetLocaleModifiers("@im=");' which was incorrect (STR 3192). Apply fix for STR 3502, using 'XSetLocaleModifiers("");' which appears to be the correct solution for using X Input Methods (XIM). This has also been backported to FLTK 1.3.6 in branch-1.3, see commit 219ae5e455e7943ffb35fdd5edbe13dcc6955423.
2020-02-09Eliminate -Wunknown-pragmas and -Wsign-compare warnings on GCCdarealshinji
2020-02-03Don't "export" X11 specific fl_open_display() functionAlbrecht Schlosser
The X11 specific overloaded function fl_open_display(Display *) has never been documented but exposed (and "exported" in the ABI) in FL/platform.H which is not necessary. This internal function is now static and no longer exposed in the ABI. Don't confuse with fl_open_display() w/o arguments which is still exported and declared in FL/platform.H.
2020-01-31Fix disabling of deprecated warningsAlbrecht Schlosser
Fix cut'n'paste error: needs #pragma pop instead of push.
2020-01-31Disable X11 "deprecated declaration" warningAlbrecht Schlosser
... for GCC >= 4.6 and clang compilers. This annoying warning exists on X11 (Linux/Unix/macOS) platforms because we need to use XKeycodeToKeysym() although it is deprecated. See STR 2913 for discussion and details.
2019-10-30Concentrate source code that supports Darwin + XQuartz + fink as test platformManoloFLTK
2019-07-18X11: support copy/paste of image via clipboard within a single appManoloFLTK
X11 requires to process differently paste if both copy and paste are within the same app or are in 2 separate apps. This was implemented for paste of text. It's now also implemented for paste of image.
2019-03-25Replace static void Fl_Window_Driver::default_icons() by virtual ↵ManoloFLTK
Fl_Screen_Driver::default_icons()
2019-03-11X11 platform: keep GUI scaling after screen is reconfiguredManoloFLTK
2019-03-11X11 platform: follow when the OS changes the Xft.dpi resourceManoloFLTK
Under gnome, Tweaks -> Fonts ->Scaling factor allows to change the size of all fonts handled by gnome. With that change, FLTK apps obey to changes to Xft.dpi.
2019-03-06Improve static function react_to_screen_reconfiguration()ManoloFLTK
2019-03-06Process env var FLTK_SCALING_FACTOR consistently across platforms.ManoloFLTK
The procedure to set screen scaling factors becomes: 1) each screen scaling factor is set to 1 2) the OS is queried according to each platform to get screen scaling factor values 3) The value of FLTK_SCALING_FACTOR, if present, is used to multiply scaling factors
2019-02-23New member function const Fl_Image* Fl_Window::shape() replaces int ↵ManoloFLTK
Fl_Window::is_shaped() The new function allows to get the window's shaping image and delete it after use, if appropriate.