summaryrefslogtreecommitdiff
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* printing: Fix crash in avahi_service_resolver_cbWGH2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | printer_name_compressed_strv is NULL-terminated array of gchar*, which means N+1 memory should be allocated. Otherwise, if the printer name has no empty components (which is usually the case), printer_name_compressed_strv[N], which should contain the NULL sentinel, will actually lie just outside of allocated memory, which is UB. In my case, it led to crashes inside g_strjoinv when Print... dialog is opened in evince. #0 0x00007fad2ce1bad7 in __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:96 #1 0x00007fad2d04d88d in g_strjoinv (separator=separator@entry=0x7fad0c9bc508 "-", str_array=str_array@entry=0x556b017f0200) at ../glib-2.60.7/glib/gstrfuncs.c:2585 #2 0x00007fad0c9b8a89 in avahi_service_resolver_cb (source_object=<optimized out>, res=<optimized out>, user_data=0x7fad08020ee0) at /var/tmp/portage/x11-libs/gtk+-3.24.13/work/gtk+-3.24.13/modules/printbackends/cups/gtkprintbackendcups.c:3223 #3 0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8b00 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209 #4 0x00007fad2d1f987d in g_task_return (task=0x556b017a8b00 [GTask], type=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1278 #5 0x00007fad2d1f9dec in g_task_return (type=G_TASK_RETURN_SUCCESS, task=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1678 #6 0x00007fad2d1f9dec in g_task_return_pointer (task=<optimized out>, result=<optimized out>, result_destroy=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1683 #7 0x00007fad2d24b6af in g_dbus_connection_call_done (source=<optimized out>, result=0x556b017a8bc0, user_data=0x556b017a8b00) at ../glib-2.60.7/gio/gdbusconnection.c:5747 #8 0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8bc0 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209 #9 0x00007fad2d1f8f09 in complete_in_idle_cb (task=0x556b017a8bc0) at ../glib-2.60.7/gio/gtask.c:1223 #10 0x00007fad2d02d2c0 in g_main_dispatch (context=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3189 #11 0x00007fad2d02d2c0 in g_main_context_dispatch (context=context@entry=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3854 #12 0x00007fad2d02d658 in g_main_context_iterate (context=context@entry=0x556b00eee090, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.60.7/glib/gmain.c:3927 #13 0x00007fad2d02d6df in g_main_context_iteration (context=context@entry=0x556b00eee090, may_block=may_block@entry=1) at ../glib-2.60.7/glib/gmain.c:3988 #14 0x00007fad2d22248d in g_application_run (application=0x556b0116f130 [EvApplication], argc=<optimized out>, argv=<optimized out>) at ../glib-2.60.7/gio/gapplication.c:2519 #15 0x0000556b002e55a1 in () #16 0x00007fad2ccd6f1b in __libc_start_main (main=0x556b002e50d0, argc=2, argv=0x7ffe1057fa88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe1057fa78) at ../csu/libc-start.c:308 #17 0x0000556b002e567a in () (gdb) p printer_name_compressed_strv[0] $4 = (gchar *) 0x556d4a4be430 "Brother" (gdb) p printer_name_compressed_strv[1] $5 = (gchar *) 0x7f9dbc011090 "MFC" (gdb) p printer_name_compressed_strv[2] $6 = (gchar *) 0x556d4a51ba50 "7860DW" (gdb) p printer_name_compressed_strv[3] $7 = (gchar *) 0x401 <error: Cannot access memory at address 0x401>
* Add missing (closure) GIR annotationsRobert Ancell2020-01-131-1/+1
|
* printing: Fill device URI for non-Avahi printersMarek Kasik2019-12-131-0/+5
| | | | | | Device URI was not filled for non-Avahi printers by my previous commit. I've added it back. It was a mistake during rebasing of the patch to current master.
* printing: Fix getting info for standalone IPP printersMarek Kasik2019-12-121-45/+90
| | | | | | | | | | | | | | Create printer name from name of the advertised service for standalone IPP printers as opposed to CUPS printers advertised via Avahi which get name from their resource path. This is similar to what cups-filters does. Pass GtkPrinter class to request for printer info so that it does not need to be searched for (such search could fail for standalone IPP printers). https://gitlab.gnome.org/GNOME/gtk/issues/1509
* printing: Don't show Rejecting Jobs when we don't knowMarek Kasik2019-12-121-0/+3
| | | | | | | | | Set reasonable default values for printers discovered by Avahi which do not have 'printer-type' attribute. This is the case for network printers which were not published by CUPS. Related to the issue #1509.
* printing: Get PPD from original host if neededMarek Kasik2019-09-193-12/+84
| | | | | Try to get PPD from original host if there is no PPD for remote printer on current CUPS server.
* meson: cups: use cups-config for looking up cupsChristoph Reiter2019-07-011-19/+3
| | | | | | | | | | | We were looking for the cups headers and the cups lib in the default locations which for example breaks with OpenBSD where the cups headers are under /usr/local/include/ Instead just use the "cups" dependency type from meson which internally uses cups-config. See #1967 Ported to master from !963
* build/cups: remove checks for httpGetAuthString and http_t.authstringChristoph Reiter2019-07-012-23/+3
| | | | | | | | httpGetAuthString() was added with cups 1.3 and we depend on a newer version now. The direct field access was a fallback in case httpGetAuthString() was missing, so this can also be dropped. Ported to master from !938
* Rename gtkprintbackend.h to gtkprintbackendprivate.hMatthias Clasen2019-05-266-6/+6
| | | | Follow the naming convention for private headers.
* Rename gtkprinter-private.hMatthias Clasen2019-05-266-6/+6
| | | | | Name this header gtkprinterprivate.h, following our convention for private headers.
* Require CUPS >= 2.0Emmanuele Bassi2019-05-075-260/+35
| | | | | Drop support for versions of CUPS < 2.0, to simplify the backend code and drop a lot of conditional blocks.
* cups: Use non-deprecated APIEmmanuele Bassi2019-05-073-2/+70
| | | | | | | The http* family of functions was deprecated after CUPS 1.7. We can conditionally use it when built against a newer version of CUPS. The additional parameters are taken directly from the fallback values inside CUPS itself.
* Detect CUPS ≥ 1.7Emmanuele Bassi2019-05-071-0/+3
| | | | | We support CUPS ≥ 1.2, but we use API that was introduced and deprecated at a later point.
* print: Check unknown option values whether they are actually custom settingsTill Kamppeter2019-04-041-4/+76
| | | | | | | | | | | Additional code improvements and fixes: - Use g_regex_match_simple() instead of sscanf() - Added spaces between function names and left parantheses - Set always correct custom page size - Added page_setup field to CupsOptionsData data structure - Replaced tab indentions by spaces - Moved #define out of add_cups_options() function, removed line breaks from regular expressions
* Merge branch 'wip/fanc999/meson.msvc' into 'master'Chun-wei Fan2019-02-231-6/+9
|\ | | | | | | | | GTK+ 4: Improve Windows/Visual Studio build experience See merge request GNOME/gtk!185
| * modules/media/meson.build: Export needed symbols on MSVCChun-wei Fan2018-12-061-6/+9
| | | | | | | | | | | | We need to override _GLIB_EXTERN to export the required symbols for the GIO module on Visual Studio, so that the media modules can be successfully loaded.
* | modules: Drop the plusEmmanuele Bassi2019-02-052-10/+10
| | | | | | | | Use 'GTK' consistently.
* | gstmedia: Implement error handling.Benjamin Otte2018-12-181-0/+14
|/ | | | | I wonder who forgot that. Whoops.
* gtkmediafile: Don't leak all the imagesBenjamin Otte2018-07-041-0/+1
| | | | | | | | | We were leaking the GBytes for the image memory, which is a noticeable memleak to anyone who's casually running a memory monitor. Go KDE users! Closes #1200
* mediafile: Check if media files are open when trying to playBenjamin Otte2018-07-042-0/+6
| | | | If no file is open, refuse to play.
* Remove a lot of Since annotationsMatthias Clasen2018-06-251-2/+0
| | | | | 4.0 will represent a clean epoch. We don't want to have lots of noise in the docs about 2.x or 3.x.
* build: Fix compiler warningsMohammed Sadiq2018-06-111-1/+1
|
* Add gtk_printer_get_hard_margins_for_paper_sizeAdrian Johnson2018-04-261-0/+48
| | | | | | | | to retreive paper size specific hard margins and use this to set the hard margins in the print context. (modified by Marek Kasik <mkasik@redhat.com>) https://bugzilla.gnome.org/show_bug.cgi?id=686109
* Terminate strncpy() buffers correctlyEmmanuele Bassi2018-04-101-2/+6
| | | | | | | | | | | | | | When using strncpy() with a buffer we need to account for the terminating NUL character. GCC 8 started warning when using PPD_MAX_NAME as the buffer length for strncpy() because the buffer we're copying into has the same length — which means that the terminating NUL may be skipped if the source string has a length of PPD_MAX_NAME. The appropriate way to handle the case where we're copying a source with a length bigger than of PPD_MAX_NAME is, as reported in the strncpy() documentation, to copy `PPD_MAX_NAME - 1` bytes, and explicitly NUL terminate the destination buffer. This has the additional benefit of avoiding the compiler warning.
* ffmpeg: Fix compile warnings for newest versionBenjamin Otte2018-04-101-1/+3
|
* paintable: Introduce gdk_paintable_new_empty()Benjamin Otte2018-04-052-2/+9
| | | | Also, use it where appropriate.
* Alternative printbackends subdir for non-UNIX OSesРуслан Ижбулатов2018-03-281-0/+2
| | | | | | | | The main buildscript expects 'print_backends' list to be defined. Since printbackends is os_unix-only, we need to define this list ourselves for other OSes. https://bugzilla.gnome.org/show_bug.cgi?id=773299
* gtk: Add a GStreamer implementation of GtkMediaFileBenjamin Otte2018-03-187-1/+959
|
* gtk: Add ffmpeg implementation of GtkMediaFileBenjamin Otte2018-03-183-0/+809
| | | | This adds a module using ffmpeg to implement the GtkMediaFile interface.
* mediafile: Turn into an extension pointMatthias Clasen2018-03-182-0/+25
| | | | | | | | | | | | | | | This way, we can support external libraries providing implementations of GtkMediaFile. We also add a media backend called 'nomedia' that can be enabled to not compile any support for GtkMediaFile. This is useful when people want to statically compile GTK into an application that does not use media. For now, this option is the default. We also support a new environment variable GTK_MEDIA that allows selecting the implementation to use. GTK_MEDIA=help can be used to get info about the available implementations.
* build: Fix printbackendsBenjamin Otte2018-03-181-8/+6
| | | | There's no "auto" option anymore, so remove checks for that option.
* Use the same arguments for print backendsEmmanuele Bassi2018-03-131-20/+11
| | | | | All the print backend shared modules should use the same C preprocessor symbols.
* Consolidate print backends into one directoryMatthias Clasen2018-03-1123-56/+65
| | | | | This will let us use GTK_PATH to load them uninstalled, which is useful for in-tree tests.
* Always include platform immodulesMatthias Clasen2018-02-2411-4818/+0
| | | | | No need to load these as gio modules, we just include them in libgtk.
* Convert immodules to use an extension pointMatthias Clasen2018-02-2410-394/+188
| | | | | | | | | | | Add an extension point called gtk-im-module, which requires the type GtkIMContext. Simplify the loading by using GIO infrastructure. Drop the locale filtering for now, I don't think it is really necessary nowadays. Convert existing platform modules to gio modules. Sill to do: Drop the conditional build machinery. Either always include them, or never.
* Remove unused variable in the CUPS print backendEmmanuele Bassi2018-02-191-2/+0
| | | | | The variable is a leftover from when we were not using the G_DEFINE_DYNAMIC_TYPE macro.
* Fix the build in the Cloudprint print backendEmmanuele Bassi2018-02-191-12/+1
| | | | Typos and re-declared functions.
* Fix build of the lpr print backendEmmanuele Bassi2018-02-191-5/+2
| | | | | Some copy-and-paste from the CUPS print backend broke the build on Continuous, where CUPS does not exist.
* build: Fix checks on enabled print backendsEmmanuele Bassi2018-02-191-4/+2
| | | | The enabled print backends are a boolean, not a 'yes/no' string.
* Fix the buildMatthias Clasen2018-02-182-3/+1
|
* Convert print backends to use a GIOExtensionPointMatthias Clasen2018-02-184-146/+105
| | | | | | Use GIOModule and GIOExtensionPoint. This is the preferred way to define extensions these days, instead of manually implementing type modules.
* gtkprintbackendcups.c: fix \n at end of a debugging noteIvan Zakharyaschev2018-02-171-1/+1
| | | | | (cherry picked from commit 7461ceebe34bfc6f882145e89e1ba2f187d08303) (cherry picked from commit d2a4febfa75182d36ffd48eb05e9054e8bf9cf53)
* Drop unmaintained print backendsMatthias Clasen2018-02-159-1725/+1
| | | | | The papi and test printbackends have not seen any maintenance in a long time.
* Fix the buildMatthias Clasen2018-02-151-0/+8
| | | | This was a mis-merge.
* Drop non-backend immodulesMatthias Clasen2018-02-1519-3901/+1
| | | | | These are not well integrated, and have not seen any maintenance in many years.
* Merge branch 'wip/carlosg/imwayland' into 'master'Matthias Clasen2018-02-153-0/+1029
|\ | | | | | | | | modules: Add wayland IM implementation See merge request GNOME/gtk!4
| * modules: Add wayland IM implementationwip/carlosg/imwaylandCarlos Garnacho2018-02-133-0/+1029
| | | | | | | | | | This IM context implementation goes through the gtk-text-input protocol, leaving up to the compositor the actual interaction with IM engines.
* | build: Coalesce print backends options into oneEmmanuele Bassi2018-02-141-4/+21
| | | | | | | | | | | | Instead of having separate options for each print backend, we can use the same approach as the input method modules: a single option, with a comma-separated list of print backends.
* | build: Rename the 'enable-colord' optionEmmanuele Bassi2018-02-141-1/+1
| | | | | | | | | | Drop the 'enable-' prefix, to follow the naming best practices for Meson configuration options.
* | build: Rename 'with-included-immodules' optionEmmanuele Bassi2018-02-141-14/+6
| | | | | | | | | | | | We can call it 'included-immodules', and simplify its logic by always attempting to split the value, to avoid turning an array into a string and then back into an array again.