Compare commits
372 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44a46234e1 | |||
| 06193cad4d | |||
| 3031b6f8c7 | |||
| e878b0f691 | |||
| fd7e0c6827 | |||
| bd725d3208 | |||
| 7ce53f3381 | |||
| 6209a8e306 | |||
| f3b1e4ebba | |||
| bb63cb41f0 | |||
| ea74712de8 | |||
| 7f9ef6f9cb | |||
| 495456c3d1 | |||
| 369fa0341b | |||
| 320fe56ca0 | |||
| db214bbd1b | |||
| a9a90c7659 | |||
| 90bca20555 | |||
| 41a07f9856 | |||
| 4935441e99 | |||
| 91417c6e04 | |||
| b1524a8ade | |||
| 45ebb6afc6 | |||
| 6db39715d9 | |||
| 6053713acd | |||
| 4ed5f5ed43 | |||
| 51a6a325d2 | |||
| bec07e2847 | |||
| 793265e020 | |||
| ed178415d9 | |||
| b64f94feba | |||
| 63240a7110 | |||
| 86852505a3 | |||
| f9167e5c99 | |||
| 680ee57a79 | |||
| 1024e0893e | |||
| 1dca723864 | |||
| 6dd558a183 | |||
| 80063414ff | |||
| eb2a73704b | |||
| 8112b925a3 | |||
| 7298f8e94d | |||
| 137c22e50c | |||
| 403f16766c | |||
| 32679cb832 | |||
| 626190e275 | |||
| 7ebc137190 | |||
| 0ba66846d7 | |||
| 720988d962 | |||
| a98d7a7569 | |||
| 8d059bb487 | |||
| a59cb7ccff | |||
| f1bcbfa8c1 | |||
| 856d360d3f | |||
| e295708854 | |||
| caacf5a5cf | |||
| 24c25d44a5 | |||
| 43da663c9e | |||
| e2453dc7cd | |||
| 9ce672a289 | |||
| b8aa684337 | |||
| 53e92dcab2 | |||
| c8ef3b1a60 | |||
| 88c463a58f | |||
| a5b3a3ec0c | |||
| 666e604949 | |||
| 113684bf8e | |||
| 4981f9d04b | |||
| 67b294ef5d | |||
| 5922bf061a | |||
| 96cf4afed1 | |||
| 92f2fd069d | |||
| 9834ddfb2e | |||
| d69ab7f70a | |||
| 5c44df5ec8 | |||
| 42b8879e6b | |||
| 10c3a24836 | |||
| 13a0402e42 | |||
| 92ade378fb | |||
| df2882ebbf | |||
| 070c4f7486 | |||
| d41543c51f | |||
| 6cc9f1dba1 | |||
| de9ba70e58 | |||
| 84eff45a17 | |||
| 9ff9c4932f | |||
| b137afe6ba | |||
| 5505bb2f2f | |||
| e43801d295 | |||
| d92d9171e2 | |||
| 6afe00fb46 | |||
| 1957e71374 | |||
| ae5fe1aa21 | |||
| 6304913795 | |||
| 3fde17b0b6 | |||
| c6f9c45033 | |||
| 974b755b4d | |||
| 694c1661b8 | |||
| 02a5fe87da | |||
| ba30d1e458 | |||
| 74a8099261 | |||
| c906dbc9f1 | |||
| 86ece29797 | |||
| 90d3c9b31a | |||
| 8fd61c4f5a | |||
| 0969dc59ef | |||
| 30e5ddfb63 | |||
| 5f80715ffb | |||
| 8d34a176c7 | |||
| 310cd19dc8 | |||
| 3b6eb70539 | |||
| b89ba25631 | |||
| 6ca325f6ef | |||
| 1790e7af77 | |||
| 9de63a147c | |||
| 88cd815efc | |||
| 1a6129d815 | |||
| 76f7e57fb6 | |||
| 4763524052 | |||
| c63dad2c53 | |||
| bf2e267526 | |||
| 9397158fbc | |||
| f7e57b5eeb | |||
| 98c74b6e5c | |||
| c51e97c15e | |||
| 86b8c796cf | |||
| 2669c207bd | |||
| 6b2a984892 | |||
| f5e192583a | |||
| a01ee5a7b0 | |||
| de595bd1c3 | |||
| 5863a41f37 | |||
| 9c4ca4ab15 | |||
| 553b332faa | |||
| 26ca5dbc6b | |||
| ff99d89f8f | |||
| 23673851b7 | |||
| 8b7091d43c | |||
| fbec4164ca | |||
| 3abb9ffa91 | |||
| d7c1a34bfd | |||
| 9a81e714d6 | |||
| 3659eb65d0 | |||
| b1a59daa71 | |||
| 72ad8b58c5 | |||
| 5c763e97c4 | |||
| 6e56aaffe3 | |||
| ab598631af | |||
| bbf775301a | |||
| 458c0b9525 | |||
| a2d723c133 | |||
| 3270bdb981 | |||
| 924c6a679b | |||
| f62505a77f | |||
| 375a1282f4 | |||
| ca8d51e6d0 | |||
| cdb3271346 | |||
| 1e419a94b5 | |||
| ff14bb504b | |||
| 00d1f73204 | |||
| 9a60a3659f | |||
| fcbb6b7fe3 | |||
| 246385a8e7 | |||
| 1e2bde6971 | |||
| 7d2f54f0f3 | |||
| 706b3ffc82 | |||
| f5b76a1f56 | |||
| 8601c0eccd | |||
| 8e2cf127e6 | |||
| 077e1999b3 | |||
| 5fb18692e0 | |||
| dcb4b48b29 | |||
| e7e55d13a4 | |||
| adcbd8add9 | |||
| 13a14d071a | |||
| 2cb24c7975 | |||
| 0377a8c408 | |||
| 101c06da53 | |||
| fb3e626400 | |||
| 6170149393 | |||
| ee841a282b | |||
| 1fde631031 | |||
| e441c17a0a | |||
| aec4dbfa94 | |||
| d1585a7a60 | |||
| b893b62d7a | |||
| e006f3ca98 | |||
| 4424bf8135 | |||
| 818266a805 | |||
| 1994f37481 | |||
| 13f45bd4cd | |||
| 1b07cf6522 | |||
| 1e7ded6a47 | |||
| 207b793316 | |||
| 4ece50a13c | |||
| 659329c168 | |||
| 162e41633d | |||
| 6f2187270e | |||
| c509a104b7 | |||
| 08e508889f | |||
| e9713145f9 | |||
| f203f7ccc0 | |||
| b9926f65a3 | |||
| efcfa0ec94 | |||
| 200ed52e92 | |||
| 304e2d5711 | |||
| 0a3122b541 | |||
| 1bac6684f1 | |||
| 9d1a64455b | |||
| c46bfcf752 | |||
| bab6cb6d97 | |||
| f58aaf2ccf | |||
| 86855f7531 | |||
| 25672b7f39 | |||
| 1065506257 | |||
| e3e84de96c | |||
| 964eb99a5e | |||
| 518023df56 | |||
| 86f197893a | |||
| ac26fc3be4 | |||
| 4ad8436316 | |||
| 631123bbd4 | |||
| 5f9a19ff33 | |||
| 587308004c | |||
| 2ebad7ec2b | |||
| fc04d6613a | |||
| 515c665b7f | |||
| 563add1325 | |||
| 0e44b8c38c | |||
| cdab14dc22 | |||
| ab300e7de3 | |||
| acdb9650e2 | |||
| 92166f1f69 | |||
| 7054b0ccff | |||
| ea0d3d2a95 | |||
| 0258c88949 | |||
| 3244d7a138 | |||
| 044e4b15a6 | |||
| f6a5dad12c | |||
| b38e4e0ac0 | |||
| 4b4533ef68 | |||
| 113ce66151 | |||
| 021d065a1f | |||
| db17324d82 | |||
| d505df90b0 | |||
| db326889f9 | |||
| 6be0f108b4 | |||
| 136409b8cd | |||
| 84e0bef150 | |||
| 0e002cbef0 | |||
| 107b5d7397 | |||
| 8efd10c9fd | |||
| 758e10ad41 | |||
| 5d5b7c9f7f | |||
| 761f19e7d7 | |||
| c33d8c7005 | |||
| 4cf6141462 | |||
| 3376093058 | |||
| 11e8573d0e | |||
| 8653bb8122 | |||
| 9e2d5b9064 | |||
| bdda7d1fa8 | |||
| 7dbe3d953d | |||
| 80a93be9e6 | |||
| a537bdc1fe | |||
| 848dd947ca | |||
| d6187a3dc4 | |||
| 96e1d7bfac | |||
| 0f28c2cd47 | |||
| 8f9693e02c | |||
| 7dac519277 | |||
| d0ad84c2a3 | |||
| 60ba261ed6 | |||
| ddde1a58a8 | |||
| 373749649e | |||
| 9187677a78 | |||
| b6402da864 | |||
| 32397f0b72 | |||
| 6e00717079 | |||
| e8863ece18 | |||
| 0100f08592 | |||
| 49bddf48ad | |||
| 4018a32e0b | |||
| e530a0ecd1 | |||
| 5e11b071a7 | |||
| 1c449e8d4a | |||
| 6144469d02 | |||
| a2a3de7861 | |||
| 69c902a146 | |||
| 0bb1991afb | |||
| 5cc3b265be | |||
| cb2950e17f | |||
| dc96266e66 | |||
| b51455712f | |||
| 9bc3a93cf9 | |||
| 115af7c96e | |||
| 139cb2a510 | |||
| a2a369ae1c | |||
| 9d8a3e99fd | |||
| 5affbbe545 | |||
| dadd81768a | |||
| a69e59132f | |||
| dfc26939cc | |||
| c961962ce6 | |||
| 6308d3a03d | |||
| 71385044fe | |||
| c1e82bf276 | |||
| 8e0c2a3fff | |||
| 99763f3dd5 | |||
| f655210f42 | |||
| 2b71170b12 | |||
| 8e6171d68e | |||
| 667bb3c869 | |||
| c752d8ad75 | |||
| 22d3a16653 | |||
| b16c9ebdf1 | |||
| 0f85624e3d | |||
| 6b401440d7 | |||
| b9c2bbc385 | |||
| 6964f9dbf1 | |||
| 85df2d3729 | |||
| 0922d4059a | |||
| f233609c93 | |||
| dee6d13f0d | |||
| 830626596b | |||
| 3ff8f55ed0 | |||
| 7ca4d22bc3 | |||
| ff8d0dc54c | |||
| 4b104c6217 | |||
| 6144b2276c | |||
| 17d1cd1506 | |||
| 40afffb9fd | |||
| b088c9de26 | |||
| 17a26eef48 | |||
| 30e234d847 | |||
| 9ce61b5c9a | |||
| 41687658ad | |||
| b8140b74e3 | |||
| 8d402589cf | |||
| b4143c6af9 | |||
| 3d76005585 | |||
| c8de4c9093 | |||
| 5d29c07087 | |||
| 13619963a0 | |||
| 79a2edd840 | |||
| f3dd4a6fee | |||
| d14cdf2998 | |||
| b6d73e7d20 | |||
| a4c6339351 | |||
| 884adaac9e | |||
| ff93dfd3eb | |||
| 8ff6d55c18 | |||
| 5d83553beb | |||
| 23572c21be | |||
| 6e4312a49a | |||
| ab2178e308 | |||
| ba91d7d3a9 | |||
| bdb146cce5 | |||
| 19a8fbf336 | |||
| 230dccf77b | |||
| 91e636d64b | |||
| 7b6cf538e1 | |||
| 5ebe040e6c | |||
| aee69615bc | |||
| 28fe00fc68 | |||
| 742a4658e8 | |||
| 6228da23b5 | |||
| db241d36e2 | |||
| 5e5372ce74 | |||
| c08f4bd2a9 | |||
| ecd8841d25 | |||
| be624e71f4 |
@@ -1,3 +1,229 @@
|
||||
Overview of Changes in GTK+ 3.20.10
|
||||
===================================
|
||||
|
||||
* Bug fixes:
|
||||
358970 gtk_scale_set_digits does not cause value to be rounded if draw-value is false...
|
||||
767391 cross-fade() not cross-fading
|
||||
770166 Can GtkButtons of arbitrary size be circular? The style class only accommodate...
|
||||
770236 gtkbindings: Add an example for gtk_binding_entry_add_signal()
|
||||
770242 gtkbindings: Clarify that widgets need has-focus for bindings to work
|
||||
770332 Notebook arrow icon wrong color after creating new tab
|
||||
770374 Gtk Treeview Editable overshoots column width when column width is small
|
||||
770550 gtkplacessidebar: fix signal marshal
|
||||
770614 GtkScale in HighContrast theme with value = 0: WARNING: allocates negative con...
|
||||
770624 Fix typos.
|
||||
770703 Fix crash when using page-down on GtkListBox
|
||||
770849 GtkLabel with padding brokenness
|
||||
774695 GtkProgressbar needs full and empty classes
|
||||
774726 GtkTreeView dnd: gtk_drag_finish remove row when reorder sinse 3.20
|
||||
775525 gtk_flow_box_get_child_at_index shouldn't crash with an invalid index
|
||||
775864 getting-started: typo tie->the
|
||||
776560 icon-browser: window opens at very narrow size, only showing 1 column of icons
|
||||
779002 Race enumerating the monitors
|
||||
|
||||
* Translation updates:
|
||||
Brazilian Portuguese
|
||||
Dutch
|
||||
Icelandic
|
||||
Kazakh
|
||||
Scottisch Gaelic
|
||||
Serbian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.9
|
||||
==================================
|
||||
|
||||
* Bug fixes:
|
||||
769287 GtkMenuToolButton:show-menu is emitted twice and breaks dynamic m...
|
||||
769603 gtk+-3.20.8: underlink issue with ld.gold - build fails: ./.libs/...
|
||||
Fix headerbar size allocation
|
||||
Use g_snprintf instead of snprintf
|
||||
|
||||
* Translation updates
|
||||
Brazilian Portuguese
|
||||
Czech
|
||||
German
|
||||
Hungarian
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Polish
|
||||
Portuguese
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.8
|
||||
==================================
|
||||
|
||||
* Revert an unintentional bump of the GLib requirement in 3.20.7
|
||||
|
||||
Overview of Changes in GTK+ 3.20.7
|
||||
==================================
|
||||
|
||||
* Bugs fixed:
|
||||
118959 GtkScale value '-0'
|
||||
674215 regression with updating tooltips
|
||||
708148 gtk_tree_view_get_path_at_pos mistakenly identifies column of ini...
|
||||
745622 Selected text not highlighted in GtkInfoBar
|
||||
747206 gtktextview: note on how to get line spacing between two paragraphs
|
||||
764060 opening a second nautilus while a delete operation is in progress...
|
||||
764203 Default background color for the 'textview border' node
|
||||
765924 Improve external drives detection
|
||||
766120 Scale draw_value() align changed from centre/right (H/V) to lefti...
|
||||
766122 Re-used filechooser displays $pwd half of the time when shown
|
||||
766341 Do not rely on memfd as it requires a fairly recent kernel
|
||||
766643 Frozen windows when unmapped with pending configure event
|
||||
766782 OpenGL in broadway leads to segmentation fault
|
||||
767058 GtkInfoBar: right-click/context menu all white
|
||||
767468 Popover over a treeview cellrenderer is hidden immediately after ...
|
||||
767705 GtkActionHelper: Change a message to a warning
|
||||
767766 CUPS 2.X detected incorrectly by configure
|
||||
767795 Warning when the "accelerator" property of GtkShortcutsShortcut ...
|
||||
767848 crash in the window test
|
||||
767851 Adwaita: popover arrows broken in some orientations
|
||||
768016 [Wayland] Submenus often get closed after ~2 seconds
|
||||
768025 entry.warning & entry.error broken
|
||||
768082 wayland: copying from Wayland to NEdit (Xwayland/Motif) doesn't work
|
||||
768142 Incorrect order of $(LIBS) and $(OBJS) in Makefile.example caused...
|
||||
768177 CLIPBOARD target request after PRIMARY request times out. GDK_SEL...
|
||||
768485 Change the priority of the window-close idle to G_PRIORITY_DEFAULT
|
||||
768657 places-view: fix open action for locations without a mount or volume
|
||||
768930 reftests: override GSETTINGS_SCHEMA_DIR when running tests
|
||||
769003 Adwaita: GtkCalendar uses a confusing style for week of year
|
||||
769047 GtkWidget <-> GtkStyleContext API not clear
|
||||
|
||||
* Translation updates:
|
||||
Indonesian
|
||||
Norwegian bokmål
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.6
|
||||
==================================
|
||||
|
||||
* Bugs fixed:
|
||||
766694 crash on save as in any gtk3 application starting 3.20.5...
|
||||
766323 GTKPopover gives warnings if visible when reparented
|
||||
766336 Crash when selecting rows with rubberbanding
|
||||
766737 stack: Only map children when necessary
|
||||
|
||||
* Translation updates:
|
||||
Arabic
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.5
|
||||
==================================
|
||||
|
||||
* Bugs fixed:
|
||||
763852 gdk/wayland: event source is not multi-thread aware
|
||||
765973 GtkRevealer need to always send "child-revealed" signal...
|
||||
766175 Translation of quotes may misinterpreted by GTK sidebar
|
||||
766233 Crash when server does not support XI2
|
||||
766440 Scale slider button has stopped discerning & rendering...
|
||||
766442 Broken drag & drop between windows
|
||||
|
||||
* Translation updates:
|
||||
Kazakh
|
||||
Portuguese
|
||||
|
||||
Overview of Changes in GTK+ 3.20.4
|
||||
==================================
|
||||
|
||||
* Bugs fixed:
|
||||
573380 gtk_tree_model_iter_parent() fails if the same iterator is used for...
|
||||
620065 Several problems related to recent files
|
||||
693077 GtkRecentManager doesn't send "changed" when file is deleted
|
||||
749405 GtkMenuSectionBox doesn't remove submenus when parent item is removed
|
||||
761651 [Wayland] glade previewer is resizing windows until it crashes gnom...
|
||||
762756 keyboard focus problem on dismiss of menus under wayland
|
||||
763768 Wrong margin used for the sidebar separator
|
||||
764395 nautilus crashed on double clicking 'other locations'
|
||||
764424 `Super` keybindings trigger without Super, on Wayland
|
||||
764585 Fix "format not a string literal" errors
|
||||
764825 [WAYLAND] Fn key resets scrolling
|
||||
764846 Code improvements in GtkApplication
|
||||
765038 Adwaita & decorations
|
||||
765065 Wayland: Hover state stuck after mouse leaving the toplevel
|
||||
765066 GtkColorChooser looks like it can select multiple colors
|
||||
765122 Duplicate/missing string in gtkprintbackendcups
|
||||
765213 info bars nearly unreadable in backdrop state because of gray font ...
|
||||
765238 gtktexthandle should avoid connecting to GtkWidget::draw
|
||||
765261 listbox: Page up/Down don't do anything with large rows
|
||||
765270 wayland: Leave existing mods on map_virtual_modifiers
|
||||
765284 debug: reduce runtime overhead in debug builds
|
||||
765471 CellRendererText shows edit entry in a wrong position for small cells
|
||||
765474 Wayland: Dialogs without transient parent crash the inspector
|
||||
765486 builtinicon: avoid calculating font-metrics in vast majority of cases
|
||||
765493 kineticscrolling: avoid stutter at tail of kinetic deceleration
|
||||
765496 Clean up gtklabel.c a bit
|
||||
765565 Wayland: Inspector GtkLabel drag'n'drop crashes client
|
||||
765567 wayland: avoid jitter in keyboard repeat
|
||||
765592 frametimings: reuse previous frame timing in common case
|
||||
765640 pixelcache: reuse existing timeout source when possible
|
||||
765644 Widget sizing problems with GtkProgressBar
|
||||
765742 GtkRedioButton and GtkCheckButton doesn't aligned right to left lan...
|
||||
765790 W32: configure does not tell which cairo version to use
|
||||
765907 [Wayland] Reversed scrolling GDK_SCROLL_UP/GDK_SCROLL_DOWN in Wayland
|
||||
765922 GtkScale labels extend past edge of widget and overlap neighboring ...
|
||||
765981 fts warning from tracker when searching for files with "-" in name
|
||||
766166 key bindings in gtk.css are ignored
|
||||
|
||||
* Translation uypdates:
|
||||
Brazilian Portuguese
|
||||
Latvian
|
||||
Polish
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.3
|
||||
==================================
|
||||
|
||||
* Bugs fixed:
|
||||
764174 Configuration dialog is too small
|
||||
764203 Default background color for the 'textview border' node
|
||||
764204 Primary and secondary carets/cursors not distinguishable by default
|
||||
764261 gtkplacesviewrow: untranslated "%s / %s available"
|
||||
764374 Busy loop while "Displays" page is active
|
||||
764378 gtk3-demo won't run without hicolor-icon-theme
|
||||
764540 gtk_scrollable_get_border is missing annotations
|
||||
764585 Fix "format not a string literal" errors
|
||||
764686 build failure after "make distclean"
|
||||
764710 GtkListBox row CSS nodes do not reflect visual order
|
||||
764835 broadway: fix documentation, correct display port details
|
||||
764664 Segfault when initializing WINTAB pressure-sensitive tablets
|
||||
|
||||
* Translation updates:
|
||||
Bulgarian
|
||||
Esperanto
|
||||
Greek
|
||||
Norwegian bokmål
|
||||
Persian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.2
|
||||
==================================
|
||||
|
||||
* Fix blue background in Emacs windows
|
||||
|
||||
* Fix a performance issue with excessive redraws
|
||||
|
||||
* Bugs fixed:
|
||||
763627 menu-traditional puts popover beneath the text editor widget
|
||||
763783 GDK W32: Erase hidden layered windows before showing them
|
||||
763851 GDK W32: show_window_menu() is not implemented
|
||||
764022 Negative content width -200 (allocation -200, extents 0x0) while...
|
||||
764170 [HighContrastInverse] “suqqested-action” is white on lightgrey
|
||||
764210 Strange Background Color on Emacs
|
||||
764321 window: Fix gtk_window_set_geometry_hints documentation
|
||||
764376 UI glitch when entering keyboard shortcut
|
||||
|
||||
* Translation updates:
|
||||
Dutch
|
||||
German
|
||||
Italian
|
||||
Lithuanian
|
||||
Serbian
|
||||
Thai
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.20.1
|
||||
==================================
|
||||
|
||||
|
||||
@@ -99,6 +99,11 @@ Release notes for 3.20
|
||||
gtk_window_set_default_size() to restore it.
|
||||
See https://wiki.gnome.org/HowDoI/SaveWindowState for a detailed example.
|
||||
|
||||
* Geometry handling in GtkWindow has been removed. If you are using the
|
||||
functions gtk_window_resize_to_geometry, gtk_window_set_default_geometry,
|
||||
gtk_window_parse_geometry or gtk_window_set_geometry_hints, you may need
|
||||
to make some changes to your code.
|
||||
|
||||
* GtkDrawingArea used to implicitly render the theme background before
|
||||
calling the ::draw handler. This is no longer the case. If you rely
|
||||
on having a theme-provided background, call gtk_render_background()
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<BinDir>$(SolutionDir)$(Configuration)\$(Platform)\bin</BinDir>
|
||||
<InstalledDlls>$(BinDir)\$(GtkDllPrefix)gdk(GtkDllSuffix).dll;$(BinDir)\$(GtkDllPrefix)gtk(GtkDllSuffix).dll;$(BinDir)\$(GtkDllPrefix)gailutil(GtkDllSuffix).dll</InstalledDlls>
|
||||
<InstalledBins>$(BinDir)\gtk3-demo.exe;$(BinDir)\gtk3-demo-application.exe;$(BinDir)\gtk3-icon-browser.exe;$(BinDir)\gtk-encode-symbolic-svg.exe</InstalledBins>
|
||||
<InstalledBroadwayBins>$(BinDir)\broadwayd.exe</InstalledBroadwayBins>
|
||||
<GtkDoInstallBin>
|
||||
mkdir $(CopyDir)\bin
|
||||
mkdir $(CopyDir)\lib
|
||||
@@ -126,18 +123,19 @@ copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib
|
||||
copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas
|
||||
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas
|
||||
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas
|
||||
|
||||
echo "Compiling gsettings XML Files..."
|
||||
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
|
||||
|
||||
echo "Generating icon cache......"
|
||||
$(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index --force "$(CopyDir)\share\icons\hicolor"
|
||||
</GtkDoInstall>
|
||||
<GtkDoInstallBroadwayHeaders>
|
||||
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
#include "gdk3-broadway.vs10.headers"
|
||||
</GtkDoInstallBroadwayHeaders>
|
||||
<GtkPostInstall>
|
||||
echo "Compiling gsettings XML Files..."
|
||||
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
|
||||
|
||||
echo "Generating icon cache......"
|
||||
$(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index --force "$(CopyDir)\share\icons\hicolor"
|
||||
</GtkPostInstall>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<_PropertySheetDisplayName>gtk3installsprops</_PropertySheetDisplayName>
|
||||
@@ -146,15 +144,6 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
<BuildMacro Include="BinDir">
|
||||
<Value>$(BinDir)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="InstalledDlls">
|
||||
<Value>$(InstalledDlls)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="InstalledBins">
|
||||
<Value>$(InstalledBins)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="InstalledBroadwayBins">
|
||||
<Value>$(InstalledBroadwayBins)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="GtkDoInstallBin">
|
||||
<Value>$(GtkDoInstallBin)</Value>
|
||||
</BuildMacro>
|
||||
@@ -164,5 +153,8 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
|
||||
<BuildMacro Include="GtkDoInstallBroadwayHeaders">
|
||||
<Value>$(GtkDoInstallBroadwayHeaders)</Value>
|
||||
</BuildMacro>
|
||||
<BuildMacro Include="GtkPostInstall">
|
||||
<Value>$(GtkPostInstall)</Value>
|
||||
</BuildMacro>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -157,29 +157,29 @@
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\..\..\config.h.win32">
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">blah;%(Outputs)</Outputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">Installing Build Results...</Message>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">blah;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -42,7 +42,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -56,7 +56,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -69,7 +69,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -84,7 +84,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -98,7 +98,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -113,7 +113,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -127,7 +127,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
|
||||
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
|
||||
@@ -128,20 +128,24 @@ copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib
|
||||
copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas

|
||||
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas

|
||||
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas

|
||||
|
||||
"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkPostInstall"
|
||||
Value="
|
||||
echo "Compiling gsettings XML Files..."

|
||||
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas

|
||||
|
||||
echo "Generating icon cache..."

|
||||
$(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index --force "$(CopyDir)\share\icons\hicolor"
|
||||
"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkDoInstallBroadwayHeaders"
|
||||
Value="
|
||||
"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="GtkDoInstallBroadwayHeaders"
|
||||
Value="
|
||||
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk

|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway

|
||||
#include "gdk3-broadway.headers"
|
||||
"
|
||||
/>
|
||||
"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
|
||||
+8
-5
@@ -10,8 +10,8 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [20])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [1])
|
||||
m4_define([gtk_micro_version], [10])
|
||||
m4_define([gtk_interface_age], [10])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -580,7 +580,7 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
|
||||
|
||||
PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
|
||||
|
||||
# Remove this check once cairo_required_version reaches at least 1.14.4
|
||||
# Remove this check once cairo_required_version reaches at least 1.16.0
|
||||
case $host_os in
|
||||
mingw*)
|
||||
PKG_CHECK_MODULES(CAIRO, [cairo >= cairo_required_version])
|
||||
@@ -588,7 +588,7 @@ case $host_os in
|
||||
[AC_MSG_RESULT([found])],
|
||||
[AC_MSG_ERROR(
|
||||
[cairo_win32_surface_create_with_format is not found in cairo library
|
||||
You need cairo version newer than 2015-04-14])])
|
||||
You need a cairo snapshot 1.15.x or 1.16.x release or newer])])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
@@ -794,6 +794,9 @@ LIBS="$LIBS $GLIB_LIBS"
|
||||
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
||||
LIBS=$gtk_save_LIBS
|
||||
|
||||
AC_CHECK_HEADERS(linux/memfd.h,
|
||||
AC_DEFINE(HAVE_LINUX_MEMFD_H, 1,
|
||||
[Define to 1 if memfd.h is available]))
|
||||
AC_CHECK_HEADERS(sys/mman.h,
|
||||
AC_DEFINE(HAVE_SYS_MMAN_H, 1,
|
||||
[Define to 1 if mman.h is available]))
|
||||
@@ -1472,7 +1475,7 @@ else
|
||||
CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
|
||||
CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
|
||||
|
||||
if test $CUPS_API_MAJOR -gt 1 -o \
|
||||
if test $CUPS_API_MAJOR -lt 1 -o \
|
||||
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -lt 2; then
|
||||
AC_MSG_ERROR([CUPS >= 1.2 not found])
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/CSS Accordion
|
||||
/* Theming/CSS Accordion
|
||||
*
|
||||
* A simple accordion demo written using CSS transitions and multiple backgrounds
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/CSS Basics
|
||||
/* Theming/CSS Basics
|
||||
*
|
||||
* Gtk themes are written using CSS. Every widget is build of multiple items
|
||||
* that you can style very similarly to a regular website.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/Multiple Backgrounds
|
||||
/* Theming/Multiple Backgrounds
|
||||
*
|
||||
* Gtk themes are written using CSS. Every widget is build of multiple items
|
||||
* that you can style very similarly to a regular website.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/Animated Backgrounds
|
||||
/* Theming/Animated Backgrounds
|
||||
*
|
||||
* This demo is done in honour of the Pixbufs demo further down.
|
||||
* It is done exclusively with CSS as the background of the window.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/Shadows
|
||||
/* Theming/Shadows
|
||||
*
|
||||
* This demo shows how to use CSS shadows.
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,8 @@ source_toggled (GtkToggleButton *button)
|
||||
markup = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
||||
gtk_text_buffer_get_start_iter (buffer, &start);
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
gtk_text_buffer_delete (buffer, &start, &end);
|
||||
gtk_text_buffer_insert_markup (buffer, &start, markup, -1);
|
||||
g_free (markup);
|
||||
|
||||
@@ -67,6 +68,7 @@ do_markup (GtkWidget *do_widget)
|
||||
g_signal_connect (show_source, "toggled", G_CALLBACK (source_toggled), stack);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header), TRUE);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), show_source);
|
||||
gtk_widget_show_all (header);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
|
||||
@@ -12,10 +12,13 @@ static guint timeout = 0;
|
||||
static void
|
||||
change_direction (GtkRevealer *revealer)
|
||||
{
|
||||
gboolean revealed;
|
||||
if (gtk_widget_get_mapped (GTK_WIDGET (revealer)))
|
||||
{
|
||||
gboolean revealed;
|
||||
|
||||
revealed = gtk_revealer_get_child_revealed (revealer);
|
||||
gtk_revealer_set_reveal_child (revealer, !revealed);
|
||||
revealed = gtk_revealer_get_child_revealed (revealer);
|
||||
gtk_revealer_set_reveal_child (revealer, !revealed);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -4,14 +4,20 @@
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">4</property>
|
||||
<property name="value">2</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="upper">4</property>
|
||||
<property name="value">2</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment3">
|
||||
<property name="upper">4</property>
|
||||
<property name="value">2</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="title" translatable="yes">Scales</property>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="row-spacing">6</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
@@ -271,5 +271,40 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">1</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Plain</property>
|
||||
<property name="halign">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Destructive</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">Suggested</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* CSS Theming/Style Classes
|
||||
/* Theming/Style Classes
|
||||
*
|
||||
* GTK+ uses CSS for theming. Style classes can be associated
|
||||
* with widgets to inform the theme about intended rendering.
|
||||
@@ -24,6 +24,7 @@ do_theming_style_classes (GtkWidget *do_widget)
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
@@ -289,7 +289,6 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* havoc column */
|
||||
@@ -311,7 +310,6 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* tim column */
|
||||
@@ -334,7 +332,6 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* owen column */
|
||||
@@ -356,7 +353,6 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
|
||||
/* dave column */
|
||||
@@ -378,7 +374,6 @@ add_columns (GtkTreeView *treeview)
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
|
||||
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
|
||||
GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
|
||||
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
</object>
|
||||
<template class="IconBrowserWindow" parent="GtkApplicationWindow">
|
||||
<property name="title" translatable="yes">Icon Browser</property>
|
||||
<property name="default-width">600</property>
|
||||
<property name="default-height">800</property>
|
||||
<property name="default-width">1024</property>
|
||||
<property name="default-height">768</property>
|
||||
<signal name="key-press-event" handler="key_press_event_cb"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
|
||||
@@ -1625,6 +1625,16 @@ reset_icon_size (GtkWidget *iv)
|
||||
gtk_widget_queue_resize (iv);
|
||||
}
|
||||
|
||||
static void
|
||||
adjustment3_value_changed (GtkAdjustment *adj, GtkProgressBar *pbar)
|
||||
{
|
||||
double fraction;
|
||||
|
||||
fraction = gtk_adjustment_get_value (adj) / (gtk_adjustment_get_upper (adj) - gtk_adjustment_get_lower (adj));
|
||||
|
||||
gtk_progress_bar_set_fraction (pbar, fraction);
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -1896,6 +1906,12 @@ activate (GApplication *app)
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "decrease_button");
|
||||
g_object_set_data (G_OBJECT (widget), "decrease_button", widget2);
|
||||
|
||||
adj = (GtkAdjustment *)gtk_builder_get_object (builder, "adjustment3");
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "progressbar1");
|
||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "progressbar2");
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget);
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget2);
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET (window));
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
@@ -103,8 +103,9 @@
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment3">
|
||||
<property name="lower">0</property>
|
||||
<property name="upper">4</property>
|
||||
<property name="value">1</property>
|
||||
<property name="value">2</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
@@ -4091,7 +4092,6 @@ bad things might happen.</property>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkPopover" id="open_popover">
|
||||
<property name="visible">1</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">1</property>
|
||||
|
||||
@@ -43,10 +43,10 @@ To use broadwayd, start it like this:
|
||||
<programlisting>
|
||||
broadwayd :5
|
||||
</programlisting>
|
||||
Then point your web browser at <literal>http://127.0.0.1:8084</literal>.
|
||||
Then point your web browser at <literal>http://127.0.0.1:8085</literal>.
|
||||
Start your applications like this:
|
||||
<programlisting>
|
||||
BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
@@ -58,11 +58,11 @@ BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
<title><envar>BROADWAY_DISPLAY</envar></title>
|
||||
|
||||
<para>
|
||||
Specifies the Broadway display number. The default display is 1.
|
||||
Specifies the Broadway display number. The default display is 0.
|
||||
The display number determines the port to use when connecting
|
||||
to a Broadway application via the following formula:
|
||||
<programlisting>
|
||||
<replaceable>port</replaceable> = 8080 + (<replaceable>display</replaceable> - 1)
|
||||
<replaceable>port</replaceable> = 8080 + <replaceable>display</replaceable>
|
||||
</programlisting>
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
@@ -45,14 +45,14 @@ windows in the same web browser, by connecting to broadwayd.
|
||||
</para>
|
||||
<para>
|
||||
When using broadwayd, specify the display number to use, prefixed
|
||||
with a colon, similar to X. The default display number is 1.
|
||||
with a colon, similar to X. The default display number is 0.
|
||||
<programlisting>
|
||||
broadwayd :5
|
||||
</programlisting>
|
||||
Then point your web browser at <literal>http://127.0.0.1:8084</literal>.
|
||||
Then point your web browser at <literal>http://127.0.0.1:8085</literal>.
|
||||
Start your applications like this:
|
||||
<programlisting>
|
||||
BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
</programlisting>
|
||||
|
||||
You can add password protection for your session by creating a file in
|
||||
|
||||
@@ -1051,7 +1051,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
when the window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
|
||||
@@ -1133,7 +1133,7 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
The default values for the #GtkScrolledWindow:hscrollbar-policy and
|
||||
#GtkScrolledWindow:vscrollbar-policy properties have been changed from
|
||||
'never' to 'automatic'. If your application was relying on the default
|
||||
value, you will have explicitly set it explicitly.
|
||||
value, you will have to set it explicitly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -1205,6 +1205,12 @@ gtk_arrow_draw (GtkWidget *widget,
|
||||
have disappeared, and instead there are now
|
||||
gtk_window_set_has_resize_grip() and gtk_window_get_has_resize_grip().
|
||||
</para>
|
||||
<para>
|
||||
In more recent versions of GTK+ 3, the resize grip functionality has
|
||||
been removed entirely, in favor of invisible resize borders around the
|
||||
window. When updating to newer versions of GTK+ 3, you should simply
|
||||
remove all code dealing with resize grips.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
@@ -13,7 +13,7 @@ all: exampleapp
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS)
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
|
||||
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS) gschemas.compiled
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f org.gtk.exampleapp.gschema.valid
|
||||
|
||||
@@ -18,7 +18,7 @@ resources.c: exampleapp.gresource.xml window.ui
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS)
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(BUILT_SRC)
|
||||
|
||||
@@ -18,7 +18,7 @@ resources.c: exampleapp.gresource.xml window.ui
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS)
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(BUILT_SRC)
|
||||
|
||||
@@ -18,7 +18,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS)
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(BUILT_SRC)
|
||||
|
||||
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS) gschemas.compiled
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f org.gtk.exampleapp.gschema.valid
|
||||
|
||||
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS) gschemas.compiled
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f org.gtk.exampleapp.gschema.valid
|
||||
|
||||
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS) gschemas.compiled
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f org.gtk.exampleapp.gschema.valid
|
||||
|
||||
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS) gschemas.compiled
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f org.gtk.exampleapp.gschema.valid
|
||||
|
||||
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
|
||||
$(CC) -c -o $(@F) $(CFLAGS) $<
|
||||
|
||||
exampleapp: $(OBJS) gschemas.compiled
|
||||
$(CC) -o $(@F) $(LIBS) $(OBJS)
|
||||
$(CC) -o $(@F) $(OBJS) $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f org.gtk.exampleapp.gschema.valid
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ common_sources = \
|
||||
|
||||
libgdk_3_la_SOURCES = $(common_sources)
|
||||
libgdk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
|
||||
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
|
||||
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS) $(SHM_LIBS)
|
||||
libgdk_3_la_LDFLAGS = $(LDADD)
|
||||
|
||||
if USE_X11
|
||||
|
||||
@@ -98,6 +98,7 @@ _gdk_broadway_window_drag_begin (GdkWindow *window,
|
||||
|
||||
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
|
||||
NULL);
|
||||
new_context->display = gdk_window_get_display (window);
|
||||
|
||||
return new_context;
|
||||
}
|
||||
|
||||
+3
-2
@@ -752,7 +752,8 @@ gdk_drag_context_handle_source_event (GdkEvent *event)
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
gdk_drag_get_cursor (GdkDragAction action)
|
||||
gdk_drag_get_cursor (GdkDragContext *context,
|
||||
GdkDragAction action)
|
||||
{
|
||||
gint i;
|
||||
|
||||
@@ -761,7 +762,7 @@ gdk_drag_get_cursor (GdkDragAction action)
|
||||
break;
|
||||
|
||||
if (drag_cursors[i].cursor == NULL)
|
||||
drag_cursors[i].cursor = gdk_cursor_new_from_name (gdk_display_get_default (),
|
||||
drag_cursors[i].cursor = gdk_cursor_new_from_name (context->display,
|
||||
drag_cursors[i].name);
|
||||
return drag_cursors[i].cursor;
|
||||
}
|
||||
|
||||
+4
-1
@@ -94,6 +94,8 @@ struct _GdkDragContext {
|
||||
/*< private >*/
|
||||
GdkDragProtocol protocol;
|
||||
|
||||
GdkDisplay *display;
|
||||
|
||||
gboolean is_source;
|
||||
GdkWindow *source_window;
|
||||
GdkWindow *dest_window;
|
||||
@@ -119,7 +121,8 @@ void gdk_drag_context_cancel (GdkDragContext *context,
|
||||
GdkDragCancelReason reason);
|
||||
gboolean gdk_drag_context_handle_source_event (GdkEvent *event);
|
||||
gboolean gdk_drag_context_handle_dest_event (GdkEvent *event);
|
||||
GdkCursor * gdk_drag_get_cursor (GdkDragAction action);
|
||||
GdkCursor * gdk_drag_get_cursor (GdkDragContext *context,
|
||||
GdkDragAction action);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+1
-6
@@ -295,6 +295,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
|
||||
while (pending_motions && pending_motions->next != NULL)
|
||||
{
|
||||
GList *next = pending_motions->next;
|
||||
gdk_event_free (pending_motions->data);
|
||||
display->queued_events = g_list_delete_link (display->queued_events,
|
||||
pending_motions);
|
||||
pending_motions = next;
|
||||
@@ -2066,12 +2067,6 @@ gdk_get_show_events (void)
|
||||
return (_gdk_debug_flags & GDK_DEBUG_EVENTS) != 0;
|
||||
}
|
||||
|
||||
/* What do we do with G_IO_NVAL?
|
||||
*/
|
||||
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
|
||||
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
|
||||
#define EXCEPTION_CONDITION (G_IO_PRI)
|
||||
|
||||
static void
|
||||
gdk_synthesize_click (GdkDisplay *display,
|
||||
GdkEvent *event,
|
||||
|
||||
+52
-4
@@ -416,12 +416,18 @@ _gdk_frame_clock_begin_frame (GdkFrameClock *frame_clock)
|
||||
priv->frame_counter++;
|
||||
priv->current = (priv->current + 1) % FRAME_HISTORY_MAX_LENGTH;
|
||||
|
||||
/* Try to steal the previous frame timing instead of discarding
|
||||
* and allocating a new one.
|
||||
*/
|
||||
if G_LIKELY (priv->n_timings == FRAME_HISTORY_MAX_LENGTH &&
|
||||
_gdk_frame_timings_steal (priv->timings[priv->current],
|
||||
priv->frame_counter))
|
||||
return;
|
||||
|
||||
if (priv->n_timings < FRAME_HISTORY_MAX_LENGTH)
|
||||
priv->n_timings++;
|
||||
else
|
||||
{
|
||||
gdk_frame_timings_unref(priv->timings[priv->current]);
|
||||
}
|
||||
gdk_frame_timings_unref(priv->timings[priv->current]);
|
||||
|
||||
priv->timings[priv->current] = _gdk_frame_timings_new (priv->frame_counter);
|
||||
}
|
||||
@@ -471,7 +477,7 @@ gdk_frame_clock_get_timings (GdkFrameClock *frame_clock,
|
||||
*
|
||||
* Returns: (nullable): the #GdkFrameTimings for the frame currently
|
||||
* being processed, or even no frame is being processed, for the
|
||||
* previous frame. Before any frames have been procesed, returns
|
||||
* previous frame. Before any frames have been processed, returns
|
||||
* %NULL.
|
||||
* Since: 3.8
|
||||
*/
|
||||
@@ -603,3 +609,45 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
|
||||
frame_counter--;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[FLUSH_EVENTS], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[BEFORE_PAINT], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[UPDATE], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[LAYOUT], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[PAINT], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[AFTER_PAINT], 0);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock)
|
||||
{
|
||||
g_signal_emit (frame_clock, signals[RESUME_EVENTS], 0);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ gdk_frame_clock_flush_idle (void *data)
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS;
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS;
|
||||
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "flush-events");
|
||||
_gdk_frame_clock_emit_flush_events (clock);
|
||||
|
||||
if ((priv->requested & ~GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS) != 0 ||
|
||||
priv->updating_count > 0)
|
||||
@@ -366,7 +366,7 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
* in them.
|
||||
*/
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT;
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "before-paint");
|
||||
_gdk_frame_clock_emit_before_paint (clock);
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_UPDATE;
|
||||
}
|
||||
/* fallthrough */
|
||||
@@ -377,7 +377,7 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
priv->updating_count > 0)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_UPDATE;
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "update");
|
||||
_gdk_frame_clock_emit_update (clock);
|
||||
}
|
||||
}
|
||||
/* fallthrough */
|
||||
@@ -405,7 +405,7 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
priv->freeze_count == 0 && iter++ < 4)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_LAYOUT;
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "layout");
|
||||
_gdk_frame_clock_emit_layout (clock);
|
||||
}
|
||||
if (iter == 5)
|
||||
g_warning ("gdk-frame-clock: layout continuously requested, giving up after 4 tries");
|
||||
@@ -427,7 +427,7 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
if (priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_PAINT;
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "paint");
|
||||
_gdk_frame_clock_emit_paint (clock);
|
||||
}
|
||||
}
|
||||
/* fallthrough */
|
||||
@@ -435,7 +435,7 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_AFTER_PAINT;
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "after-paint");
|
||||
_gdk_frame_clock_emit_after_paint (clock);
|
||||
/* the ::after-paint phase doesn't get repeated on freeze/thaw,
|
||||
*/
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
|
||||
@@ -462,7 +462,7 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
if (priv->requested & GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS;
|
||||
g_signal_emit_by_name (G_OBJECT (clock), "resume-events");
|
||||
_gdk_frame_clock_emit_resume_events (clock);
|
||||
}
|
||||
|
||||
if (priv->freeze_count == 0)
|
||||
|
||||
@@ -111,7 +111,17 @@ void _gdk_frame_clock_begin_frame (GdkFrameClock *clock);
|
||||
void _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
|
||||
GdkFrameTimings *timings);
|
||||
|
||||
GdkFrameTimings *_gdk_frame_timings_new (gint64 frame_counter);
|
||||
GdkFrameTimings *_gdk_frame_timings_new (gint64 frame_counter);
|
||||
gboolean _gdk_frame_timings_steal (GdkFrameTimings *timings,
|
||||
gint64 frame_counter);
|
||||
|
||||
void _gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "gdkframeclockprivate.h"
|
||||
|
||||
/**
|
||||
@@ -48,6 +50,21 @@ _gdk_frame_timings_new (gint64 frame_counter)
|
||||
return timings;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_frame_timings_steal (GdkFrameTimings *timings,
|
||||
gint64 frame_counter)
|
||||
{
|
||||
if (timings->ref_count == 1)
|
||||
{
|
||||
memset (timings, 0, sizeof *timings);
|
||||
timings->ref_count = 1;
|
||||
timings->frame_counter = frame_counter;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_frame_timings_ref:
|
||||
* @timings: a #GdkFrameTimings
|
||||
|
||||
@@ -248,11 +248,23 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_gl_context_real_realize (GdkGLContext *self,
|
||||
GError **error)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
"The current backend does not support OpenGL");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
klass->realize = gdk_gl_context_real_realize;
|
||||
|
||||
/**
|
||||
* GdkGLContext:display:
|
||||
*
|
||||
|
||||
+1
-1
@@ -613,7 +613,7 @@ gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
* This function is useful when matching key events against
|
||||
* accelerators.
|
||||
*
|
||||
* Returns: %TRUE if no virtual modifiers were mapped to the
|
||||
* Returns: %FALSE if two virtual modifiers were mapped to the
|
||||
* same non-virtual modifier. Note that %FALSE is also returned
|
||||
* if a virtual modifier is mapped to a non-virtual modifier that
|
||||
* was already set in @state.
|
||||
|
||||
@@ -371,7 +371,6 @@ gdk_visual_get_pixel_details (GdkVisual *visual,
|
||||
m >>= 1;
|
||||
}
|
||||
|
||||
m = pixel_mask;
|
||||
while (m & 0x1)
|
||||
{
|
||||
p++;
|
||||
|
||||
+39
-6
@@ -2769,11 +2769,20 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
|
||||
|
||||
if (window->impl_window->gl_paint_context == NULL)
|
||||
{
|
||||
GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
|
||||
if (impl_class->create_gl_context == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("The current backend does not support OpenGL"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
window->impl_window->gl_paint_context =
|
||||
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
|
||||
TRUE,
|
||||
NULL,
|
||||
&internal_error);
|
||||
impl_class->create_gl_context (window->impl_window,
|
||||
TRUE,
|
||||
NULL,
|
||||
&internal_error);
|
||||
}
|
||||
|
||||
if (internal_error != NULL)
|
||||
@@ -7663,6 +7672,7 @@ is_button_type (GdkEventType type)
|
||||
type == GDK_BUTTON_RELEASE ||
|
||||
type == GDK_TOUCH_BEGIN ||
|
||||
type == GDK_TOUCH_END ||
|
||||
type == GDK_TOUCH_CANCEL ||
|
||||
type == GDK_SCROLL;
|
||||
}
|
||||
|
||||
@@ -9286,6 +9296,7 @@ proxy_button_event (GdkEvent *source_event,
|
||||
|
||||
case GDK_TOUCH_BEGIN:
|
||||
case GDK_TOUCH_END:
|
||||
case GDK_TOUCH_CANCEL:
|
||||
convert_toplevel_coords_to_window (event_win,
|
||||
toplevel_x, toplevel_y,
|
||||
&event->button.x, &event->button.y);
|
||||
@@ -9301,7 +9312,7 @@ proxy_button_event (GdkEvent *source_event,
|
||||
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
if ((type == GDK_TOUCH_END &&
|
||||
if (((type == GDK_TOUCH_END || type == GDK_TOUCH_CANCEL) &&
|
||||
_gdk_event_get_pointer_emulated (source_event)) &&
|
||||
pointer_window == pointer_info->window_under_pointer &&
|
||||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
|
||||
@@ -9810,6 +9821,25 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
* Initially the surface contents are all 0 (transparent if contents
|
||||
* have transparency, black otherwise.)
|
||||
*
|
||||
* The @width and @height of the new surface are not affected by
|
||||
* the scaling factor of the @window, or by the @scale argument; they
|
||||
* are the size of the surface in device pixels. If you wish to create
|
||||
* an image surface capable of holding the contents of @window you can
|
||||
* use:
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* int scale = gdk_window_get_scale_factor (window);
|
||||
* int width = gdk_window_get_width (window) * scale;
|
||||
* int height = gdk_window_get_height (window) * scale;
|
||||
*
|
||||
* // format is set elsewhere
|
||||
* cairo_surface_t *surface =
|
||||
* gdk_window_create_similar_image_surface (window,
|
||||
* format,
|
||||
* width, height,
|
||||
* scale);
|
||||
* ]|
|
||||
*
|
||||
* Returns: a pointer to the newly allocated surface. The caller
|
||||
* owns the surface and should call cairo_surface_destroy() when done
|
||||
* with it.
|
||||
@@ -10284,7 +10314,8 @@ gdk_window_get_event_compression (GdkWindow *window)
|
||||
* image quality since the window manager may only need to scale the
|
||||
* icon by a small amount or not at all.
|
||||
*
|
||||
**/
|
||||
* Note that some platforms don't support window icons.
|
||||
*/
|
||||
void
|
||||
gdk_window_set_icon_list (GdkWindow *window,
|
||||
GList *pixbufs)
|
||||
@@ -10307,6 +10338,8 @@ gdk_window_set_icon_list (GdkWindow *window,
|
||||
*
|
||||
* Using %NULL for @name unsets the icon title; further calls to
|
||||
* gdk_window_set_title() will again update the icon title as well.
|
||||
*
|
||||
* Note that some platforms don't support window icons.
|
||||
**/
|
||||
void
|
||||
gdk_window_set_icon_name (GdkWindow *window,
|
||||
|
||||
@@ -587,6 +587,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
|
||||
|
||||
window = [[self contentView] gdkWindow];
|
||||
|
||||
current_context->display = gdk_window_get_display (window);
|
||||
|
||||
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
|
||||
gdk_drag_context_set_device (current_context,
|
||||
gdk_device_manager_get_client_pointer (device_manager));
|
||||
|
||||
@@ -44,6 +44,7 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
|
||||
/* Create fake context */
|
||||
_gdk_quartz_drag_source_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT,
|
||||
NULL);
|
||||
_gdk_quartz_drag_source_context->display = gdk_window_get_display (window);
|
||||
_gdk_quartz_drag_source_context->is_source = TRUE;
|
||||
|
||||
_gdk_quartz_drag_source_context->source_window = window;
|
||||
|
||||
@@ -906,7 +906,7 @@ fill_crossing_event (GdkWindow *toplevel,
|
||||
such that PINCH(STARTED), PINCH(UPDATE).... will not show a second
|
||||
PINCH(STARTED) event.
|
||||
*/
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
static void
|
||||
fill_pinch_event (GdkWindow *window,
|
||||
GdkEvent *event,
|
||||
@@ -1002,7 +1002,7 @@ fill_pinch_event (GdkWindow *window,
|
||||
}
|
||||
event->touchpad_pinch.scale = last_scale;
|
||||
}
|
||||
#endif /* OSX Version >= 10.7 */
|
||||
#endif /* OSX Version >= 10.8 */
|
||||
|
||||
static void
|
||||
fill_button_event (GdkWindow *window,
|
||||
@@ -1647,11 +1647,12 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
case NSEventTypeMagnify:
|
||||
case NSEventTypeRotate:
|
||||
/* Event handling requires [NSEvent phase] which was introduced in 10.7 */
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
|
||||
/* However - Tests on 10.7 showed that phase property does not work */
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_MOUNTAIN_LION)
|
||||
fill_pinch_event (window, event, nsevent, x, y, x_root, y_root);
|
||||
else
|
||||
return_val = FALSE;
|
||||
|
||||
@@ -14,7 +14,7 @@ AM_CPPFLAGS = \
|
||||
$(GTK_DEBUG_FLAGS) \
|
||||
$(GDK_DEP_CFLAGS)
|
||||
|
||||
LDADDS = $(GDK_DEP_LIBS)
|
||||
LDADDS = $(GDK_DEP_LIBS) $(SHM_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = \
|
||||
libgdk-wayland.la
|
||||
|
||||
@@ -110,6 +110,7 @@ struct _GdkWaylandSeat
|
||||
guint32 repeat_timer;
|
||||
guint32 repeat_key;
|
||||
guint32 repeat_count;
|
||||
gint64 repeat_deadline;
|
||||
GSettings *keyboard_settings;
|
||||
|
||||
guint cursor_timeout_id;
|
||||
@@ -404,7 +405,8 @@ gdk_wayland_device_query_state (GdkDevice *device,
|
||||
if (root_window)
|
||||
*root_window = gdk_screen_get_root_window (default_screen);
|
||||
if (child_window)
|
||||
*child_window = seat->pointer_focus;
|
||||
/* Set child only if actually a child of the given window, as XIQueryPointer() does */
|
||||
*child_window = g_list_find (window->children, seat->pointer_focus) ? seat->pointer_focus : NULL;
|
||||
if (mask)
|
||||
*mask = seat->button_modifiers | seat->key_modifiers;
|
||||
|
||||
@@ -965,6 +967,9 @@ primary_selection_selection (void *data,
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkAtom selection;
|
||||
|
||||
if (!seat->keyboard_focus)
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("primary selection selection, device %p, data offer %p",
|
||||
gtk_primary_selection_device, gtk_primary_offer));
|
||||
@@ -1049,31 +1054,36 @@ flush_scroll_event (GdkWaylandSeat *seat,
|
||||
else if (pointer_frame->discrete_x < 0)
|
||||
direction = GDK_SCROLL_RIGHT;
|
||||
else if (pointer_frame->discrete_y > 0)
|
||||
direction = GDK_SCROLL_UP;
|
||||
else
|
||||
direction = GDK_SCROLL_DOWN;
|
||||
else
|
||||
direction = GDK_SCROLL_UP;
|
||||
|
||||
flush_discrete_scroll_event (seat, direction);
|
||||
pointer_frame->discrete_x = 0;
|
||||
pointer_frame->discrete_y = 0;
|
||||
}
|
||||
|
||||
/* Axes can stop independently, if we stop on one axis but have a
|
||||
* delta on the other, we don't count it as a stop event.
|
||||
*/
|
||||
if (pointer_frame->is_scroll_stop &&
|
||||
pointer_frame->delta_x == 0 &&
|
||||
pointer_frame->delta_y == 0)
|
||||
is_stop = TRUE;
|
||||
if (pointer_frame->is_scroll_stop ||
|
||||
pointer_frame->delta_x != 0 ||
|
||||
pointer_frame->delta_y != 0)
|
||||
{
|
||||
/* Axes can stop independently, if we stop on one axis but have a
|
||||
* delta on the other, we don't count it as a stop event.
|
||||
*/
|
||||
if (pointer_frame->is_scroll_stop &&
|
||||
pointer_frame->delta_x == 0 &&
|
||||
pointer_frame->delta_y == 0)
|
||||
is_stop = TRUE;
|
||||
|
||||
flush_smooth_scroll_event (seat,
|
||||
pointer_frame->delta_x,
|
||||
pointer_frame->delta_y,
|
||||
is_stop);
|
||||
flush_smooth_scroll_event (seat,
|
||||
pointer_frame->delta_x,
|
||||
pointer_frame->delta_y,
|
||||
is_stop);
|
||||
|
||||
pointer_frame->delta_x = 0;
|
||||
pointer_frame->delta_y = 0;
|
||||
pointer_frame->discrete_x = 0;
|
||||
pointer_frame->discrete_y = 0;
|
||||
pointer_frame->is_scroll_stop = FALSE;
|
||||
pointer_frame->delta_x = 0;
|
||||
pointer_frame->delta_y = 0;
|
||||
pointer_frame->is_scroll_stop = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1378,9 +1388,6 @@ pointer_handle_frame (void *data,
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
|
||||
if (!seat->pointer_focus)
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("frame, seat %p", seat));
|
||||
|
||||
@@ -1724,6 +1731,9 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
GdkKeymap *keymap;
|
||||
xkb_keysym_t sym;
|
||||
guint delay, interval, timeout;
|
||||
gint64 begin_time, now;
|
||||
|
||||
begin_time = g_get_monotonic_time ();
|
||||
|
||||
stop_key_repeat (seat);
|
||||
|
||||
@@ -1732,6 +1742,11 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
xkb_keymap = _gdk_wayland_keymap_get_xkb_keymap (keymap);
|
||||
|
||||
sym = xkb_state_key_get_one_sym (xkb_state, key);
|
||||
if (sym == XKB_KEY_NoSymbol)
|
||||
return;
|
||||
|
||||
if (sym == XKB_KEY_NoSymbol)
|
||||
return;
|
||||
|
||||
seat->time = time_;
|
||||
seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);
|
||||
@@ -1770,10 +1785,20 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
seat->repeat_count++;
|
||||
seat->repeat_key = key;
|
||||
|
||||
interval *= 1000L;
|
||||
delay *= 1000L;
|
||||
|
||||
now = g_get_monotonic_time ();
|
||||
|
||||
if (seat->repeat_count == 1)
|
||||
timeout = delay;
|
||||
seat->repeat_deadline = begin_time + delay;
|
||||
else if (seat->repeat_deadline + interval > now)
|
||||
seat->repeat_deadline += interval;
|
||||
else
|
||||
timeout = interval;
|
||||
/* frame delay caused us to miss repeat deadline */
|
||||
seat->repeat_deadline = now;
|
||||
|
||||
timeout = (seat->repeat_deadline - now) / 1000L;
|
||||
|
||||
seat->repeat_timer =
|
||||
gdk_threads_add_timeout (timeout, keyboard_repeat, seat);
|
||||
@@ -2736,7 +2761,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
|
||||
if (native == NULL || GDK_WINDOW_DESTROYED (native))
|
||||
return GDK_GRAB_NOT_VIEWABLE;
|
||||
|
||||
gdk_wayland_seat_set_grab_window (wayland_seat, window);
|
||||
gdk_wayland_seat_set_grab_window (wayland_seat, native);
|
||||
wayland_seat->pointer_grab_time = evtime;
|
||||
|
||||
if (prepare_func)
|
||||
@@ -2755,9 +2780,9 @@ gdk_wayland_seat_grab (GdkSeat *seat,
|
||||
{
|
||||
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
|
||||
|
||||
if (prev_focus != window)
|
||||
if (prev_focus != native)
|
||||
device_emit_grab_crossing (wayland_seat->master_pointer, prev_focus,
|
||||
window, GDK_CROSSING_GRAB, evtime);
|
||||
native, GDK_CROSSING_GRAB, evtime);
|
||||
|
||||
_gdk_display_add_device_grab (display,
|
||||
wayland_seat->master_pointer,
|
||||
@@ -2780,9 +2805,9 @@ gdk_wayland_seat_grab (GdkSeat *seat,
|
||||
{
|
||||
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master);
|
||||
|
||||
if (prev_focus != window)
|
||||
if (prev_focus != native)
|
||||
device_emit_grab_crossing (wayland_seat->touch_master, prev_focus,
|
||||
window, GDK_CROSSING_GRAB, evtime);
|
||||
native, GDK_CROSSING_GRAB, evtime);
|
||||
|
||||
_gdk_display_add_device_grab (display,
|
||||
wayland_seat->touch_master,
|
||||
@@ -2801,9 +2826,9 @@ gdk_wayland_seat_grab (GdkSeat *seat,
|
||||
{
|
||||
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard);
|
||||
|
||||
if (prev_focus != window)
|
||||
if (prev_focus != native)
|
||||
device_emit_grab_crossing (wayland_seat->master_keyboard, prev_focus,
|
||||
window, GDK_CROSSING_GRAB, evtime);
|
||||
native, GDK_CROSSING_GRAB, evtime);
|
||||
|
||||
_gdk_display_add_device_grab (display,
|
||||
wayland_seat->master_keyboard,
|
||||
@@ -2893,11 +2918,11 @@ gdk_wayland_seat_get_slaves (GdkSeat *seat,
|
||||
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
|
||||
GList *slaves = NULL;
|
||||
|
||||
if (capabilities & GDK_SEAT_CAPABILITY_POINTER)
|
||||
if (wayland_seat->pointer && (capabilities & GDK_SEAT_CAPABILITY_POINTER))
|
||||
slaves = g_list_prepend (slaves, wayland_seat->pointer);
|
||||
if (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
|
||||
if (wayland_seat->keyboard && (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD))
|
||||
slaves = g_list_prepend (slaves, wayland_seat->keyboard);
|
||||
if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
|
||||
if (wayland_seat->touch && (capabilities & GDK_SEAT_CAPABILITY_TOUCH))
|
||||
slaves = g_list_prepend (slaves, wayland_seat->touch);
|
||||
|
||||
return slaves;
|
||||
@@ -2964,7 +2989,8 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
seat->data_device =
|
||||
wl_data_device_manager_get_data_device (display_wayland->data_device_manager,
|
||||
seat->wl_seat);
|
||||
seat->drop_context = _gdk_wayland_drop_context_new (seat->data_device);
|
||||
seat->drop_context = _gdk_wayland_drop_context_new (display,
|
||||
seat->data_device);
|
||||
wl_data_device_add_listener (seat->data_device,
|
||||
&data_device_listener, seat);
|
||||
|
||||
|
||||
@@ -22,7 +22,11 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_LINUX_MEMFD_H
|
||||
#include <linux/memfd.h>
|
||||
#endif
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
@@ -505,7 +509,13 @@ gdk_wayland_display_finalize (GObject *object)
|
||||
static const gchar *
|
||||
gdk_wayland_display_get_name (GdkDisplay *display)
|
||||
{
|
||||
return "Wayland";
|
||||
const gchar *name;
|
||||
|
||||
name = g_getenv ("WAYLAND_DISPLAY");
|
||||
if (name == NULL)
|
||||
name = "wayland-0";
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
static GdkScreen *
|
||||
@@ -945,6 +955,54 @@ typedef struct _GdkWaylandCairoSurfaceData {
|
||||
uint32_t scale;
|
||||
} GdkWaylandCairoSurfaceData;
|
||||
|
||||
static int
|
||||
open_shared_memory (void)
|
||||
{
|
||||
static gboolean force_shm_open = FALSE;
|
||||
int ret = -1;
|
||||
|
||||
#if !defined (__NR_memfd_create)
|
||||
force_shm_open = TRUE;
|
||||
#endif
|
||||
|
||||
do
|
||||
{
|
||||
#if defined (__NR_memfd_create)
|
||||
if (!force_shm_open)
|
||||
{
|
||||
ret = syscall (__NR_memfd_create, "gdk-wayland", MFD_CLOEXEC);
|
||||
|
||||
/* fall back to shm_open until debian stops shipping 3.16 kernel
|
||||
* See bug 766341
|
||||
*/
|
||||
if (ret < 0 && errno == ENOSYS)
|
||||
force_shm_open = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (force_shm_open)
|
||||
{
|
||||
char name[NAME_MAX - 1] = "";
|
||||
|
||||
sprintf (name, "/gdk-wayland-%x", g_random_int ());
|
||||
|
||||
ret = shm_open (name, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, 0600);
|
||||
|
||||
if (ret >= 0)
|
||||
shm_unlink (name);
|
||||
else if (errno == EEXIST)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
while (ret < 0 && errno == EINTR);
|
||||
|
||||
if (ret < 0)
|
||||
g_critical (G_STRLOC ": creating shared memory file (using %s) failed: %m",
|
||||
force_shm_open? "shm_open" : "memfd_create");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct wl_shm_pool *
|
||||
create_shm_pool (struct wl_shm *shm,
|
||||
int size,
|
||||
@@ -952,19 +1010,13 @@ create_shm_pool (struct wl_shm *shm,
|
||||
void **data_out)
|
||||
{
|
||||
struct wl_shm_pool *pool;
|
||||
int ret, fd;
|
||||
int fd;
|
||||
void *data;
|
||||
|
||||
ret = syscall (__NR_memfd_create, "gdk-wayland", MFD_CLOEXEC);
|
||||
fd = open_shared_memory ();
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
g_critical (G_STRLOC ": creating shared memory file failed: %s",
|
||||
g_strerror (-ret));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fd = ret;
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
if (ftruncate (fd, size) < 0)
|
||||
{
|
||||
|
||||
@@ -82,6 +82,9 @@ struct _GdkWaylandDisplay
|
||||
GHashTable *known_globals;
|
||||
GList *on_has_globals_closures;
|
||||
|
||||
/* Keep a list of orphaned dialogs (i.e. without parent) */
|
||||
GList *orphan_dialogs;
|
||||
|
||||
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
|
||||
gchar *cursor_theme_name;
|
||||
int cursor_theme_size;
|
||||
|
||||
@@ -427,7 +427,7 @@ gdk_wayland_drag_context_action_changed (GdkDragContext *context,
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
|
||||
cursor = gdk_drag_get_cursor (action);
|
||||
cursor = gdk_drag_get_cursor (context, action);
|
||||
gdk_drag_context_set_cursor (context, cursor);
|
||||
}
|
||||
|
||||
@@ -528,6 +528,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
|
||||
|
||||
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
|
||||
context = GDK_DRAG_CONTEXT (context_wayland);
|
||||
context->display = gdk_window_get_display (window);
|
||||
context->source_window = g_object_ref (window);
|
||||
context->is_source = TRUE;
|
||||
context->targets = g_list_copy (targets);
|
||||
@@ -552,13 +553,15 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
|
||||
}
|
||||
|
||||
GdkDragContext *
|
||||
_gdk_wayland_drop_context_new (struct wl_data_device *data_device)
|
||||
_gdk_wayland_drop_context_new (GdkDisplay *display,
|
||||
struct wl_data_device *data_device)
|
||||
{
|
||||
GdkWaylandDragContext *context_wayland;
|
||||
GdkDragContext *context;
|
||||
|
||||
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
|
||||
context = GDK_DRAG_CONTEXT (context_wayland);
|
||||
context->display = display;
|
||||
context->is_source = FALSE;
|
||||
|
||||
return context;
|
||||
|
||||
@@ -28,10 +28,9 @@ typedef struct _GdkWaylandEventSource {
|
||||
GPollFD pfd;
|
||||
uint32_t mask;
|
||||
GdkDisplay *display;
|
||||
gboolean reading;
|
||||
} GdkWaylandEventSource;
|
||||
|
||||
static GList *event_sources = NULL;
|
||||
|
||||
static gboolean
|
||||
gdk_event_source_prepare (GSource *base,
|
||||
gint *timeout)
|
||||
@@ -46,17 +45,26 @@ gdk_event_source_prepare (GSource *base,
|
||||
|
||||
/* We have to add/remove the GPollFD if we want to update our
|
||||
* poll event mask dynamically. Instead, let's just flush all
|
||||
* write on idle instead, which is what this amounts to. */
|
||||
* write on idle instead, which is what this amounts to.
|
||||
*/
|
||||
|
||||
if (_gdk_event_queue_find_first (source->display) != NULL)
|
||||
return TRUE;
|
||||
|
||||
/* wl_display_prepare_read() needs to be balanced with either
|
||||
* wl_display_read_events() or wl_display_cancel_read()
|
||||
* (in gdk_event_source_check() */
|
||||
if (source->reading)
|
||||
return FALSE;
|
||||
|
||||
/* if prepare_read() returns non-zero, there are events to be dispatched */
|
||||
if (wl_display_prepare_read (display->wl_display) != 0)
|
||||
return TRUE;
|
||||
source->reading = TRUE;
|
||||
|
||||
if (wl_display_flush (display->wl_display) < 0)
|
||||
g_error ("Error flushing display: %s", g_strerror (errno));
|
||||
|
||||
if (wl_display_dispatch_pending (display->wl_display) < 0)
|
||||
g_error ("Error dispatching display: %s", g_strerror (errno));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -64,9 +72,29 @@ static gboolean
|
||||
gdk_event_source_check (GSource *base)
|
||||
{
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkWaylandDisplay *display_wayland = (GdkWaylandDisplay *) source->display;
|
||||
|
||||
if (source->display->event_pause_count > 0)
|
||||
return _gdk_event_queue_find_first (source->display) != NULL;
|
||||
{
|
||||
if (source->reading)
|
||||
wl_display_cancel_read (display_wayland->wl_display);
|
||||
source->reading = FALSE;
|
||||
|
||||
return _gdk_event_queue_find_first (source->display) != NULL;
|
||||
}
|
||||
|
||||
/* read the events from the wayland fd into their respective queues if we have data */
|
||||
if (source->reading)
|
||||
{
|
||||
if (source->pfd.revents & G_IO_IN)
|
||||
{
|
||||
if (wl_display_read_events (display_wayland->wl_display) < 0)
|
||||
g_error ("Error reading events from display: %s", g_strerror (errno));
|
||||
}
|
||||
else
|
||||
wl_display_cancel_read (display_wayland->wl_display);
|
||||
source->reading = FALSE;
|
||||
}
|
||||
|
||||
return _gdk_event_queue_find_first (source->display) != NULL ||
|
||||
source->pfd.revents;
|
||||
@@ -98,9 +126,14 @@ gdk_event_source_dispatch (GSource *base,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_event_source_finalize (GSource *source)
|
||||
gdk_event_source_finalize (GSource *base)
|
||||
{
|
||||
event_sources = g_list_remove (event_sources, source);
|
||||
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
|
||||
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
|
||||
|
||||
if (source->reading)
|
||||
wl_display_cancel_read (display->wl_display);
|
||||
source->reading = FALSE;
|
||||
}
|
||||
|
||||
static GSourceFuncs wl_glib_source_funcs = {
|
||||
@@ -131,7 +164,8 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
|
||||
source = g_source_new (&wl_glib_source_funcs,
|
||||
sizeof (GdkWaylandEventSource));
|
||||
name = g_strdup_printf ("GDK Wayland Event source (%s)", "display name");
|
||||
name = g_strdup_printf ("GDK Wayland Event source (%s)",
|
||||
gdk_display_get_name (display));
|
||||
g_source_set_name (source, name);
|
||||
g_free (name);
|
||||
wl_source = (GdkWaylandEventSource *) source;
|
||||
@@ -146,8 +180,6 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
|
||||
g_source_set_can_recurse (source, TRUE);
|
||||
g_source_attach (source, NULL);
|
||||
|
||||
event_sources = g_list_prepend (event_sources, source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -160,14 +192,11 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
source = (GdkWaylandEventSource *) display_wayland->event_source;
|
||||
|
||||
if (source->pfd.revents & G_IO_IN)
|
||||
if (wl_display_dispatch_pending (display_wayland->wl_display) < 0)
|
||||
{
|
||||
if (wl_display_dispatch (display_wayland->wl_display) < 0)
|
||||
{
|
||||
g_warning ("Error %d (%s) dispatching to Wayland display.",
|
||||
errno, g_strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
g_warning ("Error %d (%s) dispatching to Wayland display.",
|
||||
errno, g_strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
|
||||
|
||||
@@ -351,7 +351,7 @@ gdk_wayland_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
||||
if (consumed_modifiers)
|
||||
*consumed_modifiers = get_gdk_modifiers (xkb_keymap, consumed);
|
||||
|
||||
return TRUE;
|
||||
return (sym != XKB_KEY_NoSymbol);
|
||||
}
|
||||
|
||||
static guint
|
||||
@@ -370,14 +370,62 @@ static void
|
||||
gdk_wayland_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType *state)
|
||||
{
|
||||
return;
|
||||
struct xkb_keymap *xkb_keymap;
|
||||
struct xkb_state *xkb_state;
|
||||
xkb_mod_index_t idx;
|
||||
uint32_t mods, real;
|
||||
struct { const char *name; GdkModifierType mask; } vmods[] = {
|
||||
{ "Super", GDK_SUPER_MASK },
|
||||
{ "Hyper", GDK_HYPER_MASK },
|
||||
{ "Meta", GDK_META_MASK },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
int i;
|
||||
|
||||
xkb_keymap = GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
|
||||
mods = get_xkb_modifiers (xkb_keymap, *state);
|
||||
|
||||
xkb_state = xkb_state_new (xkb_keymap);
|
||||
|
||||
for (i = 0; vmods[i].name; i++)
|
||||
{
|
||||
idx = xkb_keymap_mod_get_index (xkb_keymap, vmods[i].name);
|
||||
if (idx == XKB_MOD_INVALID)
|
||||
continue;
|
||||
|
||||
xkb_state_update_mask (xkb_state, 1 << idx, 0, 0, 0, 0, 0);
|
||||
real = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE);
|
||||
real &= 0xf0; /* ignore mapping to Lock, Shift, Control, Mod1 */
|
||||
if (mods & real)
|
||||
*state |= vmods[i].mask;
|
||||
xkb_state_update_mask (xkb_state, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
xkb_state_unref (xkb_state);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_keymap_map_virtual_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType *state)
|
||||
{
|
||||
return TRUE;
|
||||
struct xkb_keymap *xkb_keymap;
|
||||
struct xkb_state *xkb_state;
|
||||
uint32_t mods, mapped;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
xkb_keymap = GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
|
||||
mods = get_xkb_modifiers (xkb_keymap, *state);
|
||||
|
||||
xkb_state = xkb_state_new (xkb_keymap);
|
||||
xkb_state_update_mask (xkb_state, mods & ~0xff, 0, 0, 0, 0, 0);
|
||||
mapped = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE);
|
||||
if ((mapped & mods & 0xff) != 0)
|
||||
ret = FALSE;
|
||||
*state |= get_gdk_modifiers (xkb_keymap, mapped);
|
||||
|
||||
xkb_state_unref (xkb_state);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -109,7 +109,8 @@ GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window,
|
||||
void _gdk_wayland_window_offset_next_wl_buffer (GdkWindow *window,
|
||||
int x,
|
||||
int y);
|
||||
GdkDragContext * _gdk_wayland_drop_context_new (struct wl_data_device *data_device);
|
||||
GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display,
|
||||
struct wl_data_device *data_device);
|
||||
void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
|
||||
GdkWindow *window);
|
||||
void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
|
||||
|
||||
@@ -301,13 +301,7 @@ gdk_wayland_screen_is_composited (GdkScreen *screen)
|
||||
static gchar *
|
||||
gdk_wayland_screen_make_display_name (GdkScreen *screen)
|
||||
{
|
||||
const gchar *name;
|
||||
|
||||
name = g_getenv ("WAYLAND_DISPLAY");
|
||||
if (name == NULL)
|
||||
name = "wayland-0";
|
||||
|
||||
return g_strdup (name);
|
||||
return g_strdup (gdk_display_get_name (GDK_WAYLAND_SCREEN (screen)->display));
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
@@ -626,6 +620,8 @@ init_settings (GdkScreen *screen)
|
||||
screen_wayland->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
|
||||
|
||||
source = g_settings_schema_source_get_default ();
|
||||
if (source == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (translations); i++)
|
||||
{
|
||||
@@ -921,6 +917,8 @@ gdk_wayland_screen_list_visuals (GdkScreen *screen)
|
||||
#define GDK_TYPE_WAYLAND_VISUAL (_gdk_wayland_visual_get_type ())
|
||||
#define GDK_WAYLAND_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_VISUAL, GdkWaylandVisual))
|
||||
|
||||
/* Currently, the Wayland backend only ever uses ARGB8888.
|
||||
*/
|
||||
static GdkVisual *
|
||||
gdk_wayland_visual_new (GdkScreen *screen)
|
||||
{
|
||||
@@ -930,6 +928,9 @@ gdk_wayland_visual_new (GdkScreen *screen)
|
||||
visual->screen = GDK_SCREEN (screen);
|
||||
visual->type = GDK_VISUAL_TRUE_COLOR;
|
||||
visual->depth = 32;
|
||||
visual->red_mask = 0xff0000;
|
||||
visual->green_mask = 0x00ff00;
|
||||
visual->blue_mask = 0x0000ff;
|
||||
visual->bits_per_rgb = 8;
|
||||
|
||||
return visual;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <string.h>
|
||||
|
||||
typedef struct _SelectionBuffer SelectionBuffer;
|
||||
typedef struct _SelectionData SelectionData;
|
||||
typedef struct _StoredSelection StoredSelection;
|
||||
typedef struct _AsyncWriteData AsyncWriteData;
|
||||
typedef struct _DataOfferData DataOfferData;
|
||||
@@ -80,22 +81,26 @@ struct _AsyncWriteData
|
||||
gsize index;
|
||||
};
|
||||
|
||||
struct _SelectionData
|
||||
{
|
||||
DataOfferData *offer;
|
||||
GHashTable *buffers; /* Hashtable of target_atom->SelectionBuffer */
|
||||
};
|
||||
|
||||
enum {
|
||||
ATOM_PRIMARY,
|
||||
ATOM_CLIPBOARD,
|
||||
ATOM_DND
|
||||
ATOM_DND,
|
||||
N_ATOMS
|
||||
};
|
||||
|
||||
static GdkAtom atoms[3] = { 0 };
|
||||
static GdkAtom atoms[N_ATOMS] = { 0 };
|
||||
|
||||
struct _GdkWaylandSelection
|
||||
{
|
||||
/* Destination-side data */
|
||||
DataOfferData *dnd_offer;
|
||||
DataOfferData *clipboard_offer;
|
||||
DataOfferData *primary_offer;
|
||||
SelectionData selections[N_ATOMS];
|
||||
GHashTable *offers; /* Currently alive offers, Hashtable of wl_data_offer->DataOfferData */
|
||||
GHashTable *selection_buffers; /* Hashtable of target_atom->SelectionBuffer */
|
||||
|
||||
/* Source-side data */
|
||||
StoredSelection stored_selection;
|
||||
@@ -307,6 +312,7 @@ GdkWaylandSelection *
|
||||
gdk_wayland_selection_new (void)
|
||||
{
|
||||
GdkWaylandSelection *selection;
|
||||
gint i;
|
||||
|
||||
/* init atoms */
|
||||
atoms[ATOM_PRIMARY] = gdk_atom_intern_static_string ("PRIMARY");
|
||||
@@ -314,9 +320,13 @@ gdk_wayland_selection_new (void)
|
||||
atoms[ATOM_DND] = gdk_atom_intern_static_string ("GdkWaylandSelection");
|
||||
|
||||
selection = g_new0 (GdkWaylandSelection, 1);
|
||||
selection->selection_buffers =
|
||||
g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) selection_buffer_cancel_and_unref);
|
||||
for (i = 0; i < G_N_ELEMENTS (selection->selections); i++)
|
||||
{
|
||||
selection->selections[i].buffers =
|
||||
g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) selection_buffer_cancel_and_unref);
|
||||
}
|
||||
|
||||
selection->offers =
|
||||
g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) data_offer_data_free);
|
||||
@@ -328,7 +338,11 @@ gdk_wayland_selection_new (void)
|
||||
void
|
||||
gdk_wayland_selection_free (GdkWaylandSelection *selection)
|
||||
{
|
||||
g_hash_table_destroy (selection->selection_buffers);
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (selection->selections); i++)
|
||||
g_hash_table_destroy (selection->selections[i].buffers);
|
||||
|
||||
g_array_unref (selection->source_targets);
|
||||
|
||||
g_hash_table_destroy (selection->offers);
|
||||
@@ -456,16 +470,16 @@ static const struct gtk_primary_selection_offer_listener primary_offer_listener
|
||||
primary_offer_offer,
|
||||
};
|
||||
|
||||
DataOfferData *
|
||||
SelectionData *
|
||||
selection_lookup_offer_by_atom (GdkWaylandSelection *selection,
|
||||
GdkAtom selection_atom)
|
||||
{
|
||||
if (selection_atom == atoms[ATOM_PRIMARY])
|
||||
return selection->primary_offer;
|
||||
return &selection->selections[ATOM_PRIMARY];
|
||||
else if (selection_atom == atoms[ATOM_CLIPBOARD])
|
||||
return selection->clipboard_offer;
|
||||
return &selection->selections[ATOM_CLIPBOARD];
|
||||
else if (selection_atom == atoms[ATOM_DND])
|
||||
return selection->dnd_offer;
|
||||
return &selection->selections[ATOM_DND];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@@ -517,6 +531,7 @@ gdk_wayland_selection_set_offer (GdkDisplay *display,
|
||||
{
|
||||
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
|
||||
struct wl_data_offer *prev_offer;
|
||||
SelectionData *selection_data;
|
||||
DataOfferData *info;
|
||||
|
||||
info = g_hash_table_lookup (selection->offers, wl_offer);
|
||||
@@ -526,15 +541,14 @@ gdk_wayland_selection_set_offer (GdkDisplay *display,
|
||||
if (prev_offer)
|
||||
g_hash_table_remove (selection->offers, prev_offer);
|
||||
|
||||
if (selection_atom == atoms[ATOM_PRIMARY])
|
||||
selection->primary_offer = info;
|
||||
else if (selection_atom == atoms[ATOM_CLIPBOARD])
|
||||
selection->clipboard_offer = info;
|
||||
else if (selection_atom == atoms[ATOM_DND])
|
||||
selection->dnd_offer = info;
|
||||
selection_data = selection_lookup_offer_by_atom (selection, selection_atom);
|
||||
|
||||
/* Clear all buffers */
|
||||
g_hash_table_remove_all (selection->selection_buffers);
|
||||
if (selection_data)
|
||||
{
|
||||
selection_data->offer = info;
|
||||
/* Clear all buffers */
|
||||
g_hash_table_remove_all (selection_data->buffers);
|
||||
}
|
||||
}
|
||||
|
||||
gpointer
|
||||
@@ -542,12 +556,12 @@ gdk_wayland_selection_get_offer (GdkDisplay *display,
|
||||
GdkAtom selection_atom)
|
||||
{
|
||||
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
|
||||
const DataOfferData *info;
|
||||
const SelectionData *data;
|
||||
|
||||
info = selection_lookup_offer_by_atom (selection, selection_atom);
|
||||
data = selection_lookup_offer_by_atom (selection, selection_atom);
|
||||
|
||||
if (info)
|
||||
return info->offer_data;
|
||||
if (data && data->offer)
|
||||
return data->offer->offer_data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -557,12 +571,12 @@ gdk_wayland_selection_get_targets (GdkDisplay *display,
|
||||
GdkAtom selection_atom)
|
||||
{
|
||||
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
|
||||
const DataOfferData *info;
|
||||
const SelectionData *data;
|
||||
|
||||
info = selection_lookup_offer_by_atom (selection, selection_atom);
|
||||
data = selection_lookup_offer_by_atom (selection, selection_atom);
|
||||
|
||||
if (info)
|
||||
return info->targets;
|
||||
if (data && data->offer)
|
||||
return data->offer->targets;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -749,13 +763,17 @@ gdk_wayland_selection_lookup_requestor_buffer (GdkWindow *requestor)
|
||||
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
|
||||
SelectionBuffer *buffer_data;
|
||||
GHashTableIter iter;
|
||||
gint i;
|
||||
|
||||
g_hash_table_iter_init (&iter, selection->selection_buffers);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &buffer_data))
|
||||
for (i = 0; i < G_N_ELEMENTS (selection->selections); i++)
|
||||
{
|
||||
if (g_list_find (buffer_data->requestors, requestor))
|
||||
return buffer_data;
|
||||
g_hash_table_iter_init (&iter, selection->selections[i].buffers);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &buffer_data))
|
||||
{
|
||||
if (g_list_find (buffer_data->requestors, requestor))
|
||||
return buffer_data;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1255,11 +1273,16 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
guint32 time)
|
||||
{
|
||||
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
|
||||
const SelectionData *selection_data;
|
||||
SelectionBuffer *buffer_data;
|
||||
gpointer offer;
|
||||
gchar *mimetype;
|
||||
GList *target_list;
|
||||
|
||||
selection_data = selection_lookup_offer_by_atom (wayland_selection, selection);
|
||||
if (!selection_data)
|
||||
return;
|
||||
|
||||
offer = gdk_wayland_selection_get_offer (display, selection);
|
||||
target_list = gdk_wayland_selection_get_targets (display, selection);
|
||||
|
||||
@@ -1285,8 +1308,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
mimetype);
|
||||
}
|
||||
|
||||
buffer_data = g_hash_table_lookup (wayland_selection->selection_buffers,
|
||||
target);
|
||||
buffer_data = g_hash_table_lookup (selection_data->buffers, target);
|
||||
|
||||
if (buffer_data)
|
||||
selection_buffer_add_requestor (buffer_data, requestor);
|
||||
@@ -1333,7 +1355,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
g_free (targets);
|
||||
}
|
||||
|
||||
g_hash_table_insert (wayland_selection->selection_buffers,
|
||||
g_hash_table_insert (selection_data->buffers,
|
||||
GDK_ATOM_TO_POINTER (target),
|
||||
buffer_data);
|
||||
}
|
||||
@@ -1385,11 +1407,69 @@ _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
return nitems;
|
||||
}
|
||||
|
||||
/* This function has been copied straight from the x11 backend */
|
||||
static gchar *
|
||||
sanitize_utf8 (const gchar *src,
|
||||
gboolean return_latin1)
|
||||
{
|
||||
gint len = strlen (src);
|
||||
GString *result = g_string_sized_new (len);
|
||||
const gchar *p = src;
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if (*p == '\r')
|
||||
{
|
||||
p++;
|
||||
if (*p == '\n')
|
||||
p++;
|
||||
|
||||
g_string_append_c (result, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
gunichar ch = g_utf8_get_char (p);
|
||||
|
||||
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
|
||||
{
|
||||
if (return_latin1)
|
||||
{
|
||||
if (ch <= 0xff)
|
||||
g_string_append_c (result, ch);
|
||||
else
|
||||
g_string_append_printf (result,
|
||||
ch < 0x10000 ? "\\u%04x" : "\\U%08x",
|
||||
ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[7];
|
||||
gint buflen;
|
||||
|
||||
buflen = g_unichar_to_utf8 (ch, buf);
|
||||
g_string_append_len (result, buf, buflen);
|
||||
}
|
||||
}
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
}
|
||||
|
||||
return g_string_free (result, FALSE);
|
||||
}
|
||||
|
||||
gchar *
|
||||
_gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
|
||||
const gchar *str)
|
||||
{
|
||||
return NULL;
|
||||
/* This is mainly needed when interfacing with old clients through
|
||||
* Xwayland, the STRING target could be used, and passed as-is
|
||||
* by the compositor.
|
||||
*
|
||||
* There's already some handling of this atom (aka "mimetype" in
|
||||
* this backend) in common code, so we end up in this vfunc.
|
||||
*/
|
||||
return sanitize_utf8 (str, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -168,10 +168,10 @@ struct _GdkWindowImplWaylandClass
|
||||
GdkWindowImplClass parent_class;
|
||||
};
|
||||
|
||||
static void gdk_wayland_window_configure (GdkWindow *window,
|
||||
int width,
|
||||
int height,
|
||||
int scale);
|
||||
static void gdk_wayland_window_maybe_configure (GdkWindow *window,
|
||||
int width,
|
||||
int height,
|
||||
int scale);
|
||||
|
||||
static void maybe_set_gtk_surface_dbus_properties (GdkWindow *window);
|
||||
static void maybe_set_gtk_surface_modal (GdkWindow *window);
|
||||
@@ -191,14 +191,15 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
|
||||
impl->saved_height = -1;
|
||||
}
|
||||
|
||||
/* Keep a list of orphaned dialogs (i.e. without parent) */
|
||||
static GList *orphan_dialogs;
|
||||
|
||||
static void
|
||||
_gdk_wayland_screen_add_orphan_dialog (GdkWindow *window)
|
||||
{
|
||||
if (!g_list_find (orphan_dialogs, window))
|
||||
orphan_dialogs = g_list_prepend (orphan_dialogs, window);
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
if (!g_list_find (display_wayland->orphan_dialogs, window))
|
||||
display_wayland->orphan_dialogs =
|
||||
g_list_prepend (display_wayland->orphan_dialogs, window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -571,7 +572,7 @@ window_update_scale (GdkWindow *window)
|
||||
}
|
||||
|
||||
/* Notify app that scale changed */
|
||||
gdk_wayland_window_configure (window, window->width, window->height, scale);
|
||||
gdk_wayland_window_maybe_configure (window, window->width, window->height, scale);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -926,6 +927,22 @@ gdk_wayland_window_configure (GdkWindow *window,
|
||||
_gdk_wayland_display_deliver_event (display, event);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_maybe_configure (GdkWindow *window,
|
||||
int width,
|
||||
int height,
|
||||
int scale)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (window->width == width &&
|
||||
window->height == height &&
|
||||
impl->scale == scale)
|
||||
return;
|
||||
|
||||
gdk_wayland_window_configure (window, width, height, scale);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_sync_parent (GdkWindow *window,
|
||||
GdkWindow *parent)
|
||||
@@ -934,6 +951,9 @@ gdk_wayland_window_sync_parent (GdkWindow *window,
|
||||
GdkWindowImplWayland *impl_parent = NULL;
|
||||
struct xdg_surface *parent_surface;
|
||||
|
||||
g_assert (parent == NULL ||
|
||||
gdk_window_get_display (window) == gdk_window_get_display (parent));
|
||||
|
||||
if (!impl->display_server.xdg_surface)
|
||||
return;
|
||||
|
||||
@@ -959,12 +979,14 @@ gdk_wayland_window_sync_parent (GdkWindow *window,
|
||||
static void
|
||||
gdk_wayland_window_update_dialogs (GdkWindow *window)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GList *l;
|
||||
|
||||
if (!orphan_dialogs)
|
||||
if (!display_wayland->orphan_dialogs)
|
||||
return;
|
||||
|
||||
for (l = orphan_dialogs; l; l = l->next)
|
||||
for (l = display_wayland->orphan_dialogs; l; l = l->next)
|
||||
{
|
||||
GdkWindow *w = l->data;
|
||||
GdkWindowImplWayland *impl;
|
||||
@@ -1811,7 +1833,8 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
|
||||
impl->display_server.outputs = NULL;
|
||||
|
||||
if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG && !impl->transient_for)
|
||||
orphan_dialogs = g_list_remove (orphan_dialogs, window);
|
||||
display_wayland->orphan_dialogs =
|
||||
g_list_remove (display_wayland->orphan_dialogs, window);
|
||||
}
|
||||
|
||||
_gdk_wayland_window_clear_saved_size (window);
|
||||
@@ -1936,7 +1959,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
* just move the window - don't update its size
|
||||
*/
|
||||
if (width > 0 && height > 0)
|
||||
gdk_wayland_window_configure (window, width, height, impl->scale);
|
||||
gdk_wayland_window_maybe_configure (window, width, height, impl->scale);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2272,8 +2295,13 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
|
||||
GdkWindow *parent)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
GdkWindow *previous_parent;
|
||||
|
||||
g_assert (parent == NULL ||
|
||||
gdk_window_get_display (window) == gdk_window_get_display (parent));
|
||||
|
||||
if (check_transient_for_loop (window, parent))
|
||||
{
|
||||
g_warning ("Setting %p transient for %p would create a loop", window, parent);
|
||||
@@ -2291,7 +2319,8 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
|
||||
if (!parent)
|
||||
_gdk_wayland_screen_add_orphan_dialog (window);
|
||||
else if (!previous_parent)
|
||||
orphan_dialogs = g_list_remove (orphan_dialogs, window);
|
||||
display_wayland->orphan_dialogs =
|
||||
g_list_remove (display_wayland->orphan_dialogs, window);
|
||||
}
|
||||
gdk_wayland_window_sync_parent (window, NULL);
|
||||
if (should_map_as_subsurface (window) &&
|
||||
@@ -2744,7 +2773,7 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window,
|
||||
(impl->margin_left + impl->margin_right) + (left + right);
|
||||
new_height = window->height -
|
||||
(impl->margin_top + impl->margin_bottom) + (top + bottom);
|
||||
gdk_wayland_window_configure (window, new_width, new_height, impl->scale);
|
||||
gdk_wayland_window_maybe_configure (window, new_width, new_height, impl->scale);
|
||||
|
||||
impl->margin_left = left;
|
||||
impl->margin_right = right;
|
||||
|
||||
@@ -182,6 +182,7 @@ gdk_drag_context_new (GdkDisplay *display)
|
||||
|
||||
context_win32 = g_object_new (GDK_TYPE_WIN32_DRAG_CONTEXT, NULL);
|
||||
context = GDK_DRAG_CONTEXT(context_win32);
|
||||
context->display = display;
|
||||
|
||||
gdk_drag_context_set_device (context, gdk_seat_get_pointer (gdk_display_get_default_seat (display)));
|
||||
|
||||
|
||||
@@ -1053,17 +1053,17 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
|
||||
{
|
||||
if (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1907,6 +1907,77 @@ ensure_stacking_on_activate_app (MSG *msg,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
|
||||
{
|
||||
GdkWindowImplWin32 *impl;
|
||||
LONG_PTR style, tmp_style;
|
||||
gboolean maximized, minimized;
|
||||
LONG_PTR additional_styles;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
style = GetWindowLongPtr (msg->hwnd, GWL_STYLE);
|
||||
|
||||
maximized = IsZoomed (msg->hwnd);
|
||||
minimized = IsIconic (msg->hwnd);
|
||||
additional_styles = 0;
|
||||
|
||||
if (!(style & WS_SYSMENU))
|
||||
additional_styles |= WS_SYSMENU;
|
||||
|
||||
if (!maximized && !(style & WS_MAXIMIZEBOX))
|
||||
additional_styles |= WS_MAXIMIZEBOX;
|
||||
|
||||
if (!minimized && !(style & WS_MINIMIZEBOX))
|
||||
additional_styles |= WS_MINIMIZEBOX;
|
||||
|
||||
if (!minimized && !maximized && !(style & WS_SIZEBOX))
|
||||
additional_styles |= WS_SIZEBOX;
|
||||
|
||||
if (additional_styles == 0)
|
||||
/* The caller will eventually pass this to DefWindowProc (),
|
||||
* only without the style dance, which isn't needed, as it turns out.
|
||||
*/
|
||||
return FALSE;
|
||||
|
||||
/* Note: This code will enable resizing, maximizing and minimizing windows
|
||||
* via window menu even if these are non-CSD windows that were explicitly
|
||||
* forbidden from doing this by removing the appropriate styles,
|
||||
* or if these are CSD windows that were explicitly forbidden from doing
|
||||
* this by removing appropriate decorations from the headerbar and/or
|
||||
* changing hints or properties.
|
||||
*
|
||||
* If doing this for non-CSD windows is not desired,
|
||||
* do a _gdk_win32_window_lacks_wm_decorations() check and return FALSE
|
||||
* if it doesn't pass.
|
||||
*
|
||||
* If doing this for CSD windows with disabled decorations is not desired,
|
||||
* tough luck - GDK can't know which CSD decorations are enabled, and which
|
||||
* are not.
|
||||
*
|
||||
* If doing this for CSD windows with particular hints is not desired,
|
||||
* check window hints here and return FALSE (DefWindowProc() will return
|
||||
* FALSE later) or set *ret_valp to 0 and return TRUE.
|
||||
*/
|
||||
tmp_style = style | additional_styles;
|
||||
GDK_NOTE (EVENTS, g_print (" Handling WM_SYSMENU: style 0x%lx -> 0x%lx\n", style, tmp_style));
|
||||
impl->have_temp_styles = TRUE;
|
||||
impl->temp_styles = additional_styles;
|
||||
SetWindowLongPtr (msg->hwnd, GWL_STYLE, tmp_style);
|
||||
|
||||
*ret_valp = DefWindowProc (msg->hwnd, msg->message, msg->wParam, msg->lParam);
|
||||
|
||||
tmp_style = GetWindowLongPtr (msg->hwnd, GWL_STYLE);
|
||||
style = tmp_style & ~additional_styles;
|
||||
|
||||
GDK_NOTE (EVENTS, g_print (" Handling WM_SYSMENU: style 0x%lx <- 0x%lx\n", style, tmp_style));
|
||||
SetWindowLongPtr (msg->hwnd, GWL_STYLE, style);
|
||||
impl->have_temp_styles = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_win32_window_fill_min_max_info (GdkWindow *window,
|
||||
MINMAXINFO *mmi)
|
||||
@@ -2856,6 +2927,30 @@ gdk_event_translate (MSG *msg,
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SYSMENU:
|
||||
return_val = handle_wm_sysmenu (window, msg, ret_valp);
|
||||
break;
|
||||
|
||||
case WM_INITMENU:
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
if (impl->have_temp_styles)
|
||||
{
|
||||
LONG_PTR window_style;
|
||||
|
||||
window_style = GetWindowLongPtr (GDK_WINDOW_HWND (window),
|
||||
GWL_STYLE);
|
||||
/* Handling WM_SYSMENU added extra styles to this window,
|
||||
* remove them now.
|
||||
*/
|
||||
window_style &= ~impl->temp_styles;
|
||||
SetWindowLongPtr (GDK_WINDOW_HWND (window),
|
||||
GWL_STYLE,
|
||||
window_style);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
switch (msg->wParam)
|
||||
{
|
||||
|
||||
@@ -97,6 +97,18 @@
|
||||
#define WM_MOUSEHWHEEL 0x20E
|
||||
#endif
|
||||
|
||||
/* According to
|
||||
* http://blog.airesoft.co.uk/2009/11/wm_messages/
|
||||
* this is the actual internal name MS uses for this undocumented message.
|
||||
* According to
|
||||
* https://bugs.winehq.org/show_bug.cgi?id=15055
|
||||
* wParam is 0
|
||||
* lParam is a pair of virtual desktop coordinates for the popup
|
||||
*/
|
||||
#ifndef WM_SYSMENU
|
||||
#define WM_SYSMENU 0x313
|
||||
#endif
|
||||
|
||||
#ifndef CF_DIBV5
|
||||
#define CF_DIBV5 17
|
||||
#endif
|
||||
@@ -537,6 +549,9 @@ gboolean _gdk_win32_window_fill_min_max_info (GdkWindow *window,
|
||||
|
||||
gboolean _gdk_win32_window_lacks_wm_decorations (GdkWindow *window);
|
||||
|
||||
BOOL WINAPI GtkShowWindow (HWND hwnd,
|
||||
int cmd_show);
|
||||
|
||||
/* Initialization */
|
||||
void _gdk_win32_windowing_init (void);
|
||||
void _gdk_dnd_init (void);
|
||||
|
||||
+38
-50
@@ -38,7 +38,7 @@ struct _GdkWin32Screen
|
||||
GdkScreen parent_instance;
|
||||
|
||||
gint num_monitors;
|
||||
GdkWin32Monitor *monitors;
|
||||
GdkWin32Monitor **monitors;
|
||||
|
||||
GdkVisual *system_visual;
|
||||
GdkVisual *rgba_visual;
|
||||
@@ -57,6 +57,15 @@ struct _GdkWin32ScreenClass
|
||||
|
||||
G_DEFINE_TYPE (GdkWin32Screen, gdk_win32_screen, GDK_TYPE_SCREEN)
|
||||
|
||||
static void
|
||||
free_monitor (gpointer user_data)
|
||||
{
|
||||
GdkWin32Monitor *monitor = (GdkWin32Monitor *)user_data;
|
||||
|
||||
g_free (monitor->name);
|
||||
g_free (monitor);
|
||||
}
|
||||
|
||||
static gint
|
||||
get_color_precision (gulong mask)
|
||||
{
|
||||
@@ -263,9 +272,9 @@ init_root_window_size (GdkWin32Screen *screen)
|
||||
GdkRectangle rect;
|
||||
int i;
|
||||
|
||||
rect = screen->monitors[0].rect;
|
||||
rect = screen->monitors[0]->rect;
|
||||
for (i = 1; i < screen->num_monitors; i++)
|
||||
gdk_rectangle_union (&rect, &screen->monitors[i].rect, &rect);
|
||||
gdk_rectangle_union (&rect, &screen->monitors[i]->rect, &rect);
|
||||
|
||||
screen->root_window->width = rect.width;
|
||||
screen->root_window->height = rect.height;
|
||||
@@ -309,22 +318,9 @@ init_root_window (GdkWin32Screen *screen_win32)
|
||||
GDK_NOTE (MISC, g_print ("screen->root_window=%p\n", window));
|
||||
}
|
||||
|
||||
static BOOL CALLBACK
|
||||
count_monitor (HMONITOR hmonitor,
|
||||
HDC hdc,
|
||||
LPRECT rect,
|
||||
LPARAM data)
|
||||
{
|
||||
gint *n = (gint *) data;
|
||||
|
||||
(*n)++;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GdkWin32Screen *screen;
|
||||
gint index;
|
||||
GPtrArray *monitors;
|
||||
} EnumMonitorData;
|
||||
|
||||
static BOOL CALLBACK
|
||||
@@ -352,10 +348,6 @@ enum_monitor (HMONITOR hmonitor,
|
||||
MONITORINFOEXA2 monitor_info;
|
||||
HDC hDC;
|
||||
|
||||
g_assert (data->index < data->screen->num_monitors);
|
||||
|
||||
monitor = data->screen->monitors + data->index;
|
||||
|
||||
monitor_info.cbSize = sizeof (MONITORINFOEXA2);
|
||||
GetMonitorInfoA (hmonitor, (MONITORINFO *) &monitor_info);
|
||||
|
||||
@@ -363,6 +355,7 @@ enum_monitor (HMONITOR hmonitor,
|
||||
#define MONITORINFOF_PRIMARY 1
|
||||
#endif
|
||||
|
||||
monitor = g_new0 (GdkWin32Monitor, 1);
|
||||
monitor->name = g_strdup (monitor_info.szDevice);
|
||||
hDC = CreateDCA ("DISPLAY", monitor_info.szDevice, NULL, NULL);
|
||||
monitor->width_mm = GetDeviceCaps (hDC, HORZSIZE);
|
||||
@@ -377,17 +370,13 @@ enum_monitor (HMONITOR hmonitor,
|
||||
monitor->work_rect.width = monitor_info.rcWork.right - monitor_info.rcWork.left;
|
||||
monitor->work_rect.height = monitor_info.rcWork.bottom - monitor_info.rcWork.top;
|
||||
|
||||
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY && data->index != 0)
|
||||
{
|
||||
/* Put primary monitor at index 0, just in case somebody needs
|
||||
* to know which one is the primary.
|
||||
*/
|
||||
GdkWin32Monitor temp = *monitor;
|
||||
*monitor = data->screen->monitors[0];
|
||||
data->screen->monitors[0] = temp;
|
||||
}
|
||||
|
||||
data->index++;
|
||||
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY)
|
||||
/* Put primary monitor at index 0, just in case somebody needs
|
||||
* to know which one is the primary.
|
||||
*/
|
||||
g_ptr_array_insert (data->monitors, 0, monitor);
|
||||
else
|
||||
g_ptr_array_add (data->monitors, monitor);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -395,27 +384,27 @@ enum_monitor (HMONITOR hmonitor,
|
||||
static void
|
||||
init_monitors (GdkWin32Screen *screen)
|
||||
{
|
||||
gint count;
|
||||
EnumMonitorData data;
|
||||
gint i;
|
||||
|
||||
count = 0;
|
||||
EnumDisplayMonitors (NULL, NULL, count_monitor, (LPARAM) &count);
|
||||
screen->num_monitors = count;
|
||||
|
||||
screen->monitors = g_renew (GdkWin32Monitor, screen->monitors, screen->num_monitors);
|
||||
|
||||
data.screen = screen;
|
||||
data.index = 0;
|
||||
data.monitors = g_ptr_array_new ();
|
||||
|
||||
for (i = 0; i < screen->num_monitors; i++)
|
||||
free_monitor (screen->monitors[i]);
|
||||
|
||||
EnumDisplayMonitors (NULL, NULL, enum_monitor, (LPARAM) &data);
|
||||
|
||||
screen->num_monitors = data.monitors->len;
|
||||
screen->monitors = (GdkWin32Monitor **)g_ptr_array_free (data.monitors, FALSE);
|
||||
|
||||
_gdk_offset_x = G_MININT;
|
||||
_gdk_offset_y = G_MININT;
|
||||
|
||||
/* Calculate offset */
|
||||
for (i = 0; i < screen->num_monitors; i++)
|
||||
{
|
||||
GdkRectangle *rect = &screen->monitors[i].rect;
|
||||
GdkRectangle *rect = &screen->monitors[i]->rect;
|
||||
_gdk_offset_x = MAX (_gdk_offset_x, -rect->x);
|
||||
_gdk_offset_y = MAX (_gdk_offset_y, -rect->y);
|
||||
}
|
||||
@@ -426,10 +415,10 @@ init_monitors (GdkWin32Screen *screen)
|
||||
for (i = 0; i < screen->num_monitors; i++)
|
||||
{
|
||||
GdkRectangle *rect;
|
||||
rect = &screen->monitors[i].rect;
|
||||
rect = &screen->monitors[i]->rect;
|
||||
rect->x += _gdk_offset_x;
|
||||
rect->y += _gdk_offset_y;
|
||||
rect = &screen->monitors[i].work_rect;
|
||||
rect = &screen->monitors[i]->work_rect;
|
||||
rect->x += _gdk_offset_x;
|
||||
rect->y += _gdk_offset_y;
|
||||
GDK_NOTE (MISC, g_print ("Monitor %d: %dx%d@%+d%+d\n", i,
|
||||
@@ -546,7 +535,7 @@ gdk_win32_screen_get_monitor_width_mm (GdkScreen *screen,
|
||||
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
|
||||
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, 0);
|
||||
|
||||
return win32_screen->monitors[num_monitor].width_mm;
|
||||
return win32_screen->monitors[num_monitor]->width_mm;
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -558,7 +547,7 @@ gdk_win32_screen_get_monitor_height_mm (GdkScreen *screen,
|
||||
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
|
||||
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, 0);
|
||||
|
||||
return win32_screen->monitors[num_monitor].height_mm;
|
||||
return win32_screen->monitors[num_monitor]->height_mm;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
@@ -570,7 +559,7 @@ gdk_win32_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), NULL);
|
||||
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, NULL);
|
||||
|
||||
return g_strdup (win32_screen->monitors[num_monitor].name);
|
||||
return g_strdup (win32_screen->monitors[num_monitor]->name);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -583,7 +572,7 @@ gdk_win32_screen_get_monitor_geometry (GdkScreen *screen,
|
||||
g_return_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()));
|
||||
g_return_if_fail (num_monitor < win32_screen->num_monitors);
|
||||
|
||||
*dest = win32_screen->monitors[num_monitor].rect;
|
||||
*dest = win32_screen->monitors[num_monitor]->rect;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -596,7 +585,7 @@ gdk_win32_screen_get_monitor_workarea (GdkScreen *screen,
|
||||
g_return_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()));
|
||||
g_return_if_fail (num_monitor < win32_screen->num_monitors);
|
||||
|
||||
*dest = win32_screen->monitors[num_monitor].work_rect;
|
||||
*dest = win32_screen->monitors[num_monitor]->work_rect;
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -754,8 +743,7 @@ gdk_win32_screen_finalize (GObject *object)
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < screen->num_monitors; i++)
|
||||
g_free (screen->monitors[i].name);
|
||||
g_free (screen->monitors);
|
||||
free_monitor (screen->monitors[i]);
|
||||
|
||||
G_OBJECT_CLASS (gdk_win32_screen_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
+122
-18
@@ -643,7 +643,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
|
||||
/* check consistency of redundant information */
|
||||
guint remaining_mask = attributes_mask;
|
||||
|
||||
g_return_if_fail (display == gdk_display_get_default ());
|
||||
g_return_if_fail (display == _gdk_display);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_print ("_gdk_window_impl_new: %s %s\n",
|
||||
@@ -1145,7 +1145,7 @@ show_window_internal (GdkWindow *window,
|
||||
!already_mapped &&
|
||||
(window->state & GDK_WINDOW_STATE_ICONIFIED))
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMINNOACTIVE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMINNOACTIVE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1318,29 +1318,29 @@ show_window_internal (GdkWindow *window,
|
||||
}
|
||||
else if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
}
|
||||
else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
{
|
||||
if (focus_on_map)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
}
|
||||
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
|
||||
{
|
||||
if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
|
||||
}
|
||||
else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
|
||||
}
|
||||
|
||||
/* Sync STATE_ABOVE to TOPMOST */
|
||||
@@ -1395,7 +1395,7 @@ gdk_win32_window_hide (GdkWindow *window)
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2785,7 +2785,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
|
||||
}
|
||||
|
||||
SetWindowPos (GDK_WINDOW_HWND (window), insert_after,
|
||||
0, 0,
|
||||
rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
flags);
|
||||
}
|
||||
@@ -3415,7 +3415,7 @@ gdk_win32_window_iconify (GdkWindow *window)
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
old_active_window = GetActiveWindow ();
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
|
||||
if (old_active_window != GDK_WINDOW_HWND (window))
|
||||
SetActiveWindow (old_active_window);
|
||||
}
|
||||
@@ -3486,7 +3486,7 @@ gdk_win32_window_maximize (GdkWindow *window)
|
||||
_gdk_win32_window_state_to_string (window->state)));
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
|
||||
else
|
||||
gdk_synthesize_window_state (window,
|
||||
0,
|
||||
@@ -3506,7 +3506,7 @@ gdk_win32_window_unmaximize (GdkWindow *window)
|
||||
_gdk_win32_window_state_to_string (window->state)));
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
else
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_MAXIMIZED,
|
||||
@@ -3658,13 +3658,13 @@ gdk_win32_window_focus (GdkWindow *window,
|
||||
_gdk_win32_window_state_to_string (window->state)));
|
||||
|
||||
if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
|
||||
else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
|
||||
else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
|
||||
else
|
||||
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
|
||||
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
|
||||
|
||||
SetFocus (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
@@ -3968,6 +3968,33 @@ gdk_win32_window_is_win32 (GdkWindow *window)
|
||||
return GDK_WINDOW_IS_WIN32 (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_win32_window_show_window_menu (GdkWindow *window,
|
||||
GdkEvent *event)
|
||||
{
|
||||
double event_x, event_y;
|
||||
gint x, y;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
case GDK_TOUCH_BEGIN:
|
||||
case GDK_TOUCH_END:
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_event_get_root_coords (event, &event_x, &event_y);
|
||||
x = event_x - _gdk_offset_x;
|
||||
y = event_y - _gdk_offset_y;
|
||||
|
||||
SendMessage (GDK_WINDOW_HWND (window), WM_SYSMENU, 0, MAKELPARAM (x, y));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_win32_acquire_dc
|
||||
* @impl: a Win32 #GdkWindowImplWin32 implementation
|
||||
@@ -4157,6 +4184,81 @@ gdk_win32_ref_cairo_surface (GdkWindow *window)
|
||||
return impl->cairo_surface;
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
GtkShowWindow (HWND hwnd,
|
||||
int cmd_show)
|
||||
{
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
RECT window_rect;
|
||||
HDC hdc;
|
||||
POINT window_position;
|
||||
SIZE window_size;
|
||||
POINT source_point;
|
||||
BLENDFUNCTION blender;
|
||||
|
||||
switch (cmd_show)
|
||||
{
|
||||
case SW_FORCEMINIMIZE:
|
||||
case SW_HIDE:
|
||||
case SW_MINIMIZE:
|
||||
break;
|
||||
case SW_MAXIMIZE:
|
||||
case SW_RESTORE:
|
||||
case SW_SHOW:
|
||||
case SW_SHOWDEFAULT:
|
||||
case SW_SHOWMINIMIZED:
|
||||
case SW_SHOWMINNOACTIVE:
|
||||
case SW_SHOWNA:
|
||||
case SW_SHOWNOACTIVATE:
|
||||
case SW_SHOWNORMAL:
|
||||
if (IsWindowVisible (hwnd))
|
||||
break;
|
||||
|
||||
if ((WS_EX_LAYERED & GetWindowLongPtr (hwnd, GWL_EXSTYLE)) != WS_EX_LAYERED)
|
||||
break;
|
||||
|
||||
/* Window was hidden, will be shown. Erase it, GDK will repaint soon,
|
||||
* but not soon enough, so it's possible to see old content before
|
||||
* the next redraw, unless we erase the window first.
|
||||
*/
|
||||
GetWindowRect (hwnd, &window_rect);
|
||||
source_point.x = source_point.y = 0;
|
||||
|
||||
window_position.x = window_rect.left;
|
||||
window_position.y = window_rect.top;
|
||||
window_size.cx = window_rect.right - window_rect.left;
|
||||
window_size.cy = window_rect.bottom - window_rect.top;
|
||||
|
||||
blender.BlendOp = AC_SRC_OVER;
|
||||
blender.BlendFlags = 0;
|
||||
blender.AlphaFormat = AC_SRC_ALPHA;
|
||||
blender.SourceConstantAlpha = 255;
|
||||
|
||||
/* Create a surface of appropriate size and clear it */
|
||||
surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32, window_size.cx, window_size.cy);
|
||||
cr = cairo_create (surface);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
cairo_surface_flush (surface);
|
||||
hdc = cairo_win32_surface_get_dc (surface);
|
||||
|
||||
/* No API_CALL() wrapper, don't check for errors */
|
||||
UpdateLayeredWindow (hwnd, NULL,
|
||||
&window_position, &window_size,
|
||||
hdc, &source_point,
|
||||
0, &blender, ULW_ALPHA);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return ShowWindow (hwnd, cmd_show);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
|
||||
{
|
||||
@@ -4197,6 +4299,8 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
|
||||
|
||||
//impl_class->beep = gdk_x11_window_beep;
|
||||
|
||||
|
||||
impl_class->show_window_menu = gdk_win32_window_show_window_menu;
|
||||
impl_class->focus = gdk_win32_window_focus;
|
||||
impl_class->set_type_hint = gdk_win32_window_set_type_hint;
|
||||
impl_class->get_type_hint = gdk_win32_window_get_type_hint;
|
||||
|
||||
@@ -141,6 +141,11 @@ struct _GdkWindowImplWin32
|
||||
*/
|
||||
guint layered : 1;
|
||||
|
||||
/* If TRUE, the @temp_styles is set to the styles that were temporarily
|
||||
* added to this window.
|
||||
*/
|
||||
guint have_temp_styles : 1;
|
||||
|
||||
/* GDK does not keep window contents around, it just draws new
|
||||
* stuff over the window where changes occurred.
|
||||
* cache_surface retains old window contents, because
|
||||
@@ -173,6 +178,12 @@ struct _GdkWindowImplWin32
|
||||
|
||||
/* No. of windows to force layered windows off */
|
||||
guint suppress_layered;
|
||||
|
||||
/* Temporary styles that this window got for the purpose of
|
||||
* handling WM_SYSMENU.
|
||||
* They are removed at the first opportunity (usually WM_INITMENU).
|
||||
*/
|
||||
LONG_PTR temp_styles;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWin32Class
|
||||
|
||||
@@ -2878,10 +2878,14 @@ gdk_x11_display_get_default_seat (GdkDisplay *display)
|
||||
{
|
||||
GList *seats, *l;
|
||||
int device_id;
|
||||
gboolean result = FALSE;
|
||||
|
||||
seats = gdk_display_list_seats (display);
|
||||
XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display),
|
||||
None, &device_id);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
result = XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display),
|
||||
None, &device_id);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
for (l = seats; l; l = l->next)
|
||||
{
|
||||
@@ -2889,7 +2893,7 @@ gdk_x11_display_get_default_seat (GdkDisplay *display)
|
||||
|
||||
pointer = gdk_seat_get_pointer (l->data);
|
||||
|
||||
if (gdk_x11_device_get_id (pointer) == device_id)
|
||||
if (gdk_x11_device_get_id (pointer) == device_id || !result)
|
||||
{
|
||||
GdkSeat *seat = l->data;
|
||||
g_list_free (seats);
|
||||
|
||||
+16
-2
@@ -1705,6 +1705,7 @@ xdnd_enter_filter (GdkXEvent *xev,
|
||||
context_x11 = (GdkX11DragContext *)g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, NULL);
|
||||
context = (GdkDragContext *)context_x11;
|
||||
|
||||
context->display = display;
|
||||
context->protocol = GDK_DRAG_PROTO_XDND;
|
||||
context_x11->version = version;
|
||||
|
||||
@@ -2020,6 +2021,7 @@ _gdk_x11_window_drag_begin (GdkWindow *window,
|
||||
|
||||
context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, NULL);
|
||||
|
||||
context->display = gdk_window_get_display (window);
|
||||
context->is_source = TRUE;
|
||||
context->source_window = window;
|
||||
g_object_ref (window);
|
||||
@@ -2654,6 +2656,7 @@ drag_context_grab (GdkDragContext *context)
|
||||
{
|
||||
GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context);
|
||||
GdkDevice *device = gdk_drag_context_get_device (context);
|
||||
GdkSeatCapabilities capabilities;
|
||||
GdkWindow *root;
|
||||
GdkSeat *seat;
|
||||
gint keycode, i;
|
||||
@@ -2664,8 +2667,15 @@ drag_context_grab (GdkDragContext *context)
|
||||
root = gdk_screen_get_root_window (gdk_window_get_screen (x11_context->ipc_window));
|
||||
seat = gdk_device_get_seat (gdk_drag_context_get_device (context));
|
||||
|
||||
#ifdef XINPUT_2
|
||||
if (GDK_IS_X11_DEVICE_XI2 (device))
|
||||
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING;
|
||||
else
|
||||
#endif
|
||||
capabilities = GDK_SEAT_CAPABILITY_ALL;
|
||||
|
||||
if (gdk_seat_grab (seat, x11_context->ipc_window,
|
||||
GDK_SEAT_CAPABILITY_ALL, FALSE,
|
||||
capabilities, FALSE,
|
||||
x11_context->cursor, NULL, NULL, NULL) != GDK_GRAB_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
@@ -3032,6 +3042,10 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context,
|
||||
event->grab_window == x11_context->ipc_window)
|
||||
return FALSE;
|
||||
|
||||
if (gdk_event_get_device ((GdkEvent *) event) !=
|
||||
gdk_drag_context_get_device (context))
|
||||
return FALSE;
|
||||
|
||||
gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -3132,6 +3146,6 @@ gdk_x11_drag_context_action_changed (GdkDragContext *context,
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
|
||||
cursor = gdk_drag_get_cursor (action);
|
||||
cursor = gdk_drag_get_cursor (context, action);
|
||||
gdk_drag_context_set_cursor (context, cursor);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,6 @@ static GSourceFuncs event_funcs = {
|
||||
gdk_event_source_finalize
|
||||
};
|
||||
|
||||
static GList *event_sources = NULL;
|
||||
|
||||
static gint
|
||||
gdk_event_apply_filters (XEvent *xevent,
|
||||
GdkEvent *event,
|
||||
@@ -383,8 +381,6 @@ gdk_event_source_finalize (GSource *source)
|
||||
|
||||
g_list_free (event_source->translators);
|
||||
event_source->translators = NULL;
|
||||
|
||||
event_sources = g_list_remove (event_sources, source);
|
||||
}
|
||||
|
||||
GSource *
|
||||
@@ -415,8 +411,6 @@ gdk_x11_event_source_new (GdkDisplay *display)
|
||||
g_source_set_can_recurse (source, TRUE);
|
||||
g_source_attach (source, NULL);
|
||||
|
||||
event_sources = g_list_prepend (event_sources, source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,7 +329,8 @@ gail_finish_select (GtkWidget *widget)
|
||||
g_signal_connect (submenu, "map",
|
||||
G_CALLBACK (gail_map_submenu_cb),
|
||||
NULL);
|
||||
return;
|
||||
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* If we are waiting to report focus on a menubar or a menu item
|
||||
|
||||
@@ -464,7 +464,7 @@ set_recent_manager (GtkRecentAction *action,
|
||||
GtkRecentActionPrivate *priv = action->priv;
|
||||
|
||||
if (manager)
|
||||
priv->manager = NULL;
|
||||
priv->manager = manager;
|
||||
else
|
||||
priv->manager = gtk_recent_manager_get_default ();
|
||||
}
|
||||
@@ -475,8 +475,6 @@ gtk_recent_action_finalize (GObject *gobject)
|
||||
GtkRecentAction *action = GTK_RECENT_ACTION (gobject);
|
||||
GtkRecentActionPrivate *priv = action->priv;
|
||||
|
||||
priv->manager = NULL;
|
||||
|
||||
if (priv->data_destroy)
|
||||
{
|
||||
priv->data_destroy (priv->sort_data);
|
||||
@@ -503,6 +501,8 @@ gtk_recent_action_dispose (GObject *gobject)
|
||||
priv->current_filter = NULL;
|
||||
}
|
||||
|
||||
priv->manager = NULL;
|
||||
|
||||
G_OBJECT_CLASS (gtk_recent_action_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
||||
|
||||
@@ -1267,16 +1267,16 @@ get_child_node (GtkUIManager *manager,
|
||||
NODE_INFO (child)->name,
|
||||
NODE_INFO (child)->type);
|
||||
|
||||
if (node_is_dead (child))
|
||||
{
|
||||
/* This node was removed but is still dirty so
|
||||
* it is still in the tree. We want to treat this
|
||||
* as if it didn't exist, which means we move it
|
||||
* to the position it would have been created at.
|
||||
*/
|
||||
g_node_unlink (child);
|
||||
goto insert_child;
|
||||
}
|
||||
if (node_is_dead (child))
|
||||
{
|
||||
/* This node was removed but is still dirty so
|
||||
* it is still in the tree. We want to treat this
|
||||
* as if it didn't exist, which means we move it
|
||||
* to the position it would have been created at.
|
||||
*/
|
||||
g_node_unlink (child);
|
||||
goto insert_child;
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
@@ -3199,44 +3199,6 @@ mark_node_dirty (GNode *node)
|
||||
NODE_INFO (p)->dirty = TRUE;
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
open_tag_format (NodeType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case NODE_TYPE_UNDECIDED: return "%*s<UNDECIDED";
|
||||
case NODE_TYPE_ROOT: return "%*s<ui";
|
||||
case NODE_TYPE_MENUBAR: return "%*s<menubar";
|
||||
case NODE_TYPE_MENU: return "%*s<menu";
|
||||
case NODE_TYPE_TOOLBAR: return "%*s<toolbar";
|
||||
case NODE_TYPE_MENU_PLACEHOLDER:
|
||||
case NODE_TYPE_TOOLBAR_PLACEHOLDER: return "%*s<placeholder";
|
||||
case NODE_TYPE_POPUP: return "%*s<popup";
|
||||
case NODE_TYPE_MENUITEM: return "%*s<menuitem";
|
||||
case NODE_TYPE_TOOLITEM: return "%*s<toolitem";
|
||||
case NODE_TYPE_SEPARATOR: return "%*s<separator";
|
||||
case NODE_TYPE_ACCELERATOR: return "%*s<accelerator";
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
close_tag_format (NodeType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case NODE_TYPE_UNDECIDED: return "%*s</UNDECIDED>\n";
|
||||
case NODE_TYPE_ROOT: return "%*s</ui>\n";
|
||||
case NODE_TYPE_MENUBAR: return "%*s</menubar>\n";
|
||||
case NODE_TYPE_MENU: return "%*s</menu>\n";
|
||||
case NODE_TYPE_TOOLBAR: return "%*s</toolbar>\n";
|
||||
case NODE_TYPE_MENU_PLACEHOLDER:
|
||||
case NODE_TYPE_TOOLBAR_PLACEHOLDER: return "%*s</placeholder>\n";
|
||||
case NODE_TYPE_POPUP: return "%*s</popup>\n";
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_node (GtkUIManager *manager,
|
||||
GNode *node,
|
||||
@@ -3245,15 +3207,48 @@ print_node (GtkUIManager *manager,
|
||||
{
|
||||
Node *mnode;
|
||||
GNode *child;
|
||||
const gchar *open_fmt;
|
||||
const gchar *close_fmt;
|
||||
|
||||
mnode = node->data;
|
||||
|
||||
open_fmt = open_tag_format (mnode->type);
|
||||
close_fmt = close_tag_format (mnode->type);
|
||||
|
||||
g_string_append_printf (buffer, open_fmt, indent_level, "");
|
||||
switch (mnode->type)
|
||||
{
|
||||
case NODE_TYPE_UNDECIDED:
|
||||
g_string_append_printf (buffer, "%*s<UNDECIDED", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_ROOT:
|
||||
g_string_append_printf (buffer, "%*s<ui", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENUBAR:
|
||||
g_string_append_printf (buffer, "%*s<menubar", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENU:
|
||||
g_string_append_printf (buffer, "%*s<menu", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_TOOLBAR:
|
||||
g_string_append_printf (buffer, "%*s<toolbar", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENU_PLACEHOLDER:
|
||||
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
|
||||
g_string_append_printf (buffer, "%*s<placeholder", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_POPUP:
|
||||
g_string_append_printf (buffer, "%*s<popup", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENUITEM:
|
||||
g_string_append_printf (buffer, "%*s<menuitem", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_TOOLITEM:
|
||||
g_string_append_printf (buffer, "%*s<toolitem", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_SEPARATOR:
|
||||
g_string_append_printf (buffer, "%*s<separator", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_ACCELERATOR:
|
||||
g_string_append_printf (buffer, "%*s<accelerator", indent_level, "");
|
||||
break;
|
||||
default:
|
||||
;; /* Nothing */
|
||||
}
|
||||
|
||||
if (mnode->type != NODE_TYPE_ROOT)
|
||||
{
|
||||
@@ -3265,13 +3260,53 @@ print_node (GtkUIManager *manager,
|
||||
g_quark_to_string (mnode->action_name));
|
||||
}
|
||||
|
||||
g_string_append (buffer, close_fmt ? ">\n" : "/>\n");
|
||||
switch (mnode->type)
|
||||
{
|
||||
case NODE_TYPE_UNDECIDED:
|
||||
case NODE_TYPE_ROOT:
|
||||
case NODE_TYPE_MENUBAR:
|
||||
case NODE_TYPE_MENU:
|
||||
case NODE_TYPE_TOOLBAR:
|
||||
case NODE_TYPE_MENU_PLACEHOLDER:
|
||||
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
|
||||
case NODE_TYPE_POPUP:
|
||||
g_string_append (buffer, ">\n");
|
||||
break;
|
||||
default:
|
||||
g_string_append (buffer, "/>\n");
|
||||
break;
|
||||
}
|
||||
|
||||
for (child = node->children; child != NULL; child = child->next)
|
||||
print_node (manager, child, indent_level + 2, buffer);
|
||||
|
||||
if (close_fmt)
|
||||
g_string_append_printf (buffer, close_fmt, indent_level, "");
|
||||
switch (mnode->type)
|
||||
{
|
||||
case NODE_TYPE_UNDECIDED:
|
||||
g_string_append_printf (buffer, "%*s</UNDECIDED>\n", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_ROOT:
|
||||
g_string_append_printf (buffer, "%*s</ui>\n", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENUBAR:
|
||||
g_string_append_printf (buffer, "%*s</menubar>\n", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENU:
|
||||
g_string_append_printf (buffer, "%*s</menu>\n", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_TOOLBAR:
|
||||
g_string_append_printf (buffer, "%*s</toolbar>\n", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_MENU_PLACEHOLDER:
|
||||
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
|
||||
g_string_append_printf (buffer, "%*s</placeholder>\n", indent_level, "");
|
||||
break;
|
||||
case NODE_TYPE_POPUP:
|
||||
g_string_append_printf (buffer, "%*s</popup>\n", indent_level, "");
|
||||
break;
|
||||
default:
|
||||
;; /* Nothing */
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -164,6 +164,7 @@ needs_explicit_setting (MyParserData *data,
|
||||
{ "GtkCalendar", "year", 0 },
|
||||
{ "GtkCalendar", "month", 0 },
|
||||
{ "GtkCalendar", "day", 0 },
|
||||
{ "GtkDialog", "border-width", 0 },
|
||||
{ "GtkPlacesSidebar", "show-desktop", 0 },
|
||||
{ "GtkRadioButton", "draw-indicator", 0 },
|
||||
{ "GtkGrid", "left-attach", 1 },
|
||||
|
||||
@@ -108,11 +108,6 @@ typedef struct
|
||||
const gchar *url;
|
||||
} LicenseInfo;
|
||||
|
||||
/* Translators: this is the license preamble; the string at the end
|
||||
* contains the name of the license as link text.
|
||||
*/
|
||||
static const gchar *gtk_license_preamble = N_("This program comes with absolutely no warranty.\nSee the <a href=\"%s\">%s</a> for details.");
|
||||
|
||||
/* LicenseInfo for each GtkLicense type; keep in the same order as the enumeration */
|
||||
static const LicenseInfo gtk_license_info [] = {
|
||||
{ N_("License"), NULL },
|
||||
@@ -2488,7 +2483,10 @@ gtk_about_dialog_set_license_type (GtkAboutDialog *about,
|
||||
url = priv->website_url;
|
||||
|
||||
str = g_string_sized_new (256);
|
||||
g_string_append_printf (str, _(gtk_license_preamble), url, name);
|
||||
/* Translators: this is the license preamble; the string at the end
|
||||
* contains the name of the license as link text.
|
||||
*/
|
||||
g_string_append_printf (str, _("This program comes with absolutely no warranty.\nSee the <a href=\"%s\">%s</a> for details."), url, name);
|
||||
|
||||
g_free (priv->license);
|
||||
priv->license = g_string_free (str, FALSE);
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
* The action will be looked up in action groups that are found among
|
||||
* the widgets ancestors. Most commonly, these will be the actions with
|
||||
* the “win.” or “app.” prefix that are associated with the #GtkApplicationWindow
|
||||
* or "GtkApplication, but other action groups that are added with
|
||||
* or #GtkApplication, but other action groups that are added with
|
||||
* gtk_widget_insert_action_group() will be consulted as well.
|
||||
*
|
||||
* Since: 3.4
|
||||
|
||||
@@ -147,12 +147,12 @@ gtk_action_helper_action_added (GtkActionHelper *helper,
|
||||
|
||||
if (!helper->can_activate)
|
||||
{
|
||||
GTK_NOTE(ACTIONS, g_message ("%s: action %s can't be activated due to parameter type mismatch "
|
||||
"(parameter type %s, target type %s)",
|
||||
"actionhelper",
|
||||
helper->action_name,
|
||||
parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
|
||||
helper->target ? g_variant_get_type_string (helper->target) : "NULL"));
|
||||
g_warning ("%s: action %s can't be activated due to parameter type mismatch "
|
||||
"(parameter type %s, target type %s)",
|
||||
"actionhelper",
|
||||
helper->action_name,
|
||||
parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
|
||||
helper->target ? g_variant_get_type_string (helper->target) : "NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+45
-51
@@ -103,8 +103,8 @@
|
||||
* defines a #GtkShortcutsWindow with ID "help_overlay" then GtkApplication
|
||||
* associates an instance of this shortcuts window with each
|
||||
* #GtkApplicationWindow and sets up keyboard accelerators (Control-F1
|
||||
* and Control-?) to open it. To create an menu item that displays the
|
||||
* shortcuts window associate the item with the action win.show-help-overlay.
|
||||
* and Control-?) to open it. To create a menu item that displays the
|
||||
* shortcuts window, associate the item with the action win.show-help-overlay.
|
||||
*
|
||||
* ## A simple application ## {#gtkapplication}
|
||||
*
|
||||
@@ -525,7 +525,7 @@ gtk_application_focus_in_event_cb (GtkWindow *window,
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (application), gtk_application_props[PROP_ACTIVE_WINDOW]);
|
||||
|
||||
return FALSE;
|
||||
return GDK_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -607,14 +607,16 @@ gtk_application_load_resources (GtkApplication *application)
|
||||
|
||||
path = g_strconcat (base_path, "/gtk/help-overlay.ui", NULL);
|
||||
if (g_resources_get_info (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
|
||||
{
|
||||
const gchar * const accels[] = { "<Primary>F1", "<Primary>question", NULL };
|
||||
{
|
||||
const gchar * const accels[] = { "<Primary>F1", "<Primary>question", NULL };
|
||||
|
||||
application->priv->help_overlay_path = path;
|
||||
gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);
|
||||
}
|
||||
else
|
||||
g_free (path);
|
||||
application->priv->help_overlay_path = path;
|
||||
gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free (path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -628,7 +630,7 @@ gtk_application_startup (GApplication *g_application)
|
||||
|
||||
gtk_action_muxer_insert (application->priv->muxer, "app", G_ACTION_GROUP (application));
|
||||
|
||||
gtk_init (0, 0);
|
||||
gtk_init (NULL, NULL);
|
||||
|
||||
application->priv->impl = gtk_application_impl_new (application, gdk_display_get_default ());
|
||||
gtk_application_impl_startup (application->priv->impl, application->priv->register_session);
|
||||
@@ -808,10 +810,15 @@ extract_accel_from_menu_item (GMenuModel *model,
|
||||
}
|
||||
g_object_unref (iter);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (accel && action)
|
||||
gtk_application_add_accelerator (app, accel, action, target);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
{
|
||||
const gchar *accels[2] = { accel, NULL };
|
||||
gchar *detailed_action_name;
|
||||
|
||||
detailed_action_name = g_action_print_detailed_name (action, target);
|
||||
gtk_application_set_accels_for_action (app, detailed_action_name, accels);
|
||||
g_free (detailed_action_name);
|
||||
}
|
||||
|
||||
if (target)
|
||||
g_variant_unref (target);
|
||||
@@ -822,19 +829,19 @@ extract_accels_from_menu (GMenuModel *model,
|
||||
GtkApplication *app)
|
||||
{
|
||||
gint i;
|
||||
GMenuLinkIter *iter;
|
||||
const gchar *key;
|
||||
GMenuModel *m;
|
||||
|
||||
for (i = 0; i < g_menu_model_get_n_items (model); i++)
|
||||
{
|
||||
GMenuLinkIter *iter;
|
||||
GMenuModel *sub_model;
|
||||
|
||||
extract_accel_from_menu_item (model, i, app);
|
||||
|
||||
iter = g_menu_model_iterate_item_links (model, i);
|
||||
while (g_menu_link_iter_get_next (iter, &key, &m))
|
||||
while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
|
||||
{
|
||||
extract_accels_from_menu (m, app);
|
||||
g_object_unref (m);
|
||||
extract_accels_from_menu (sub_model, app);
|
||||
g_object_unref (sub_model);
|
||||
}
|
||||
g_object_unref (iter);
|
||||
}
|
||||
@@ -1157,6 +1164,9 @@ gtk_application_get_windows (GtkApplication *application)
|
||||
*
|
||||
* Returns the #GtkApplicationWindow with the given ID.
|
||||
*
|
||||
* The ID of a #GtkApplicationWindow can be retrieved with
|
||||
* gtk_application_window_get_id().
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the window with ID @id, or
|
||||
* %NULL if there is no window with this ID
|
||||
*
|
||||
@@ -1248,17 +1258,15 @@ gtk_application_add_accelerator (GtkApplication *application,
|
||||
GVariant *parameter)
|
||||
{
|
||||
const gchar *accelerators[2] = { accelerator, NULL };
|
||||
gchar *action_and_target;
|
||||
gchar *detailed_action_name;
|
||||
|
||||
g_return_if_fail (GTK_IS_APPLICATION (application));
|
||||
g_return_if_fail (action_name != NULL);
|
||||
g_return_if_fail (accelerator != NULL);
|
||||
|
||||
action_and_target = gtk_print_action_and_target (NULL, action_name, parameter);
|
||||
accels_set_accels_for_action (&application->priv->accels, action_and_target, accelerators);
|
||||
gtk_action_muxer_set_primary_accel (application->priv->muxer, action_and_target, accelerator);
|
||||
gtk_application_update_accels (application);
|
||||
g_free (action_and_target);
|
||||
detailed_action_name = g_action_print_detailed_name (action_name, parameter);
|
||||
gtk_application_set_accels_for_action (application, detailed_action_name, accelerators);
|
||||
g_free (detailed_action_name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1280,16 +1288,15 @@ gtk_application_remove_accelerator (GtkApplication *application,
|
||||
const gchar *action_name,
|
||||
GVariant *parameter)
|
||||
{
|
||||
gchar *action_and_target;
|
||||
const gchar *accelerators[1] = { NULL };
|
||||
gchar *detailed_action_name;
|
||||
|
||||
g_return_if_fail (GTK_IS_APPLICATION (application));
|
||||
g_return_if_fail (action_name != NULL);
|
||||
|
||||
action_and_target = gtk_print_action_and_target (NULL, action_name, parameter);
|
||||
accels_set_accels_for_action (&application->priv->accels, action_and_target, NULL);
|
||||
gtk_action_muxer_set_primary_accel (application->priv->muxer, action_and_target, NULL);
|
||||
gtk_application_update_accels (application);
|
||||
g_free (action_and_target);
|
||||
detailed_action_name = g_action_print_detailed_name (action_name, parameter);
|
||||
gtk_application_set_accels_for_action (application, detailed_action_name, accelerators);
|
||||
g_free (detailed_action_name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1376,16 +1383,8 @@ gtk_application_set_app_menu (GtkApplication *application,
|
||||
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
|
||||
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
|
||||
|
||||
if (app_menu != application->priv->app_menu)
|
||||
if (g_set_object (&application->priv->app_menu, app_menu))
|
||||
{
|
||||
if (application->priv->app_menu != NULL)
|
||||
g_object_unref (application->priv->app_menu);
|
||||
|
||||
application->priv->app_menu = app_menu;
|
||||
|
||||
if (application->priv->app_menu != NULL)
|
||||
g_object_ref (application->priv->app_menu);
|
||||
|
||||
if (app_menu)
|
||||
extract_accels_from_menu (app_menu, application);
|
||||
|
||||
@@ -1448,16 +1447,8 @@ gtk_application_set_menubar (GtkApplication *application,
|
||||
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
|
||||
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
|
||||
|
||||
if (menubar != application->priv->menubar)
|
||||
if (g_set_object (&application->priv->menubar, menubar))
|
||||
{
|
||||
if (application->priv->menubar != NULL)
|
||||
g_object_unref (application->priv->menubar);
|
||||
|
||||
application->priv->menubar = menubar;
|
||||
|
||||
if (application->priv->menubar != NULL)
|
||||
g_object_ref (application->priv->menubar);
|
||||
|
||||
if (menubar)
|
||||
extract_accels_from_menu (menubar, application);
|
||||
|
||||
@@ -1518,7 +1509,7 @@ gtk_application_get_menubar (GtkApplication *application)
|
||||
* types of actions that may be blocked are specified by the @flags
|
||||
* parameter. When the application completes the operation it should
|
||||
* call gtk_application_uninhibit() to remove the inhibitor. Note that
|
||||
* an application can have multiple inhibitors, and all of the must
|
||||
* an application can have multiple inhibitors, and all of them must
|
||||
* be individually removed. Inhibitors are also cleared when the
|
||||
* application exits.
|
||||
*
|
||||
@@ -1702,6 +1693,9 @@ normalise_detailed_name (const gchar *detailed_action_name)
|
||||
* To remove all accelerators for an action, use an empty, zero-terminated
|
||||
* array for @accels.
|
||||
*
|
||||
* For the @detailed_action_name, see g_action_parse_detailed_name() and
|
||||
* g_action_print_detailed_name().
|
||||
*
|
||||
* Since: 3.12
|
||||
*/
|
||||
void
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
* @title: GtkApplicationWindow
|
||||
* @short_description: GtkWindow subclass with GtkApplication support
|
||||
*
|
||||
* GtkApplicationWindow is a #GtkWindow subclass that offers some
|
||||
* #GtkApplicationWindow is a #GtkWindow subclass that offers some
|
||||
* extra functionality for better integration with #GtkApplication
|
||||
* features. Notably, it can handle both the application menu as well
|
||||
* as the menubar. See gtk_application_set_app_menu() and
|
||||
@@ -52,9 +52,9 @@
|
||||
* prefix. Actions must be addressed with the prefixed name when
|
||||
* referring to them from a #GMenuModel.
|
||||
*
|
||||
* Note that widgets that are placed inside a GtkApplicationWindow
|
||||
* Note that widgets that are placed inside a #GtkApplicationWindow
|
||||
* can also activate these actions, if they implement the
|
||||
* GtkActionable interface.
|
||||
* #GtkActionable interface.
|
||||
*
|
||||
* As with #GtkApplication, the GDK lock will be acquired when
|
||||
* processing actions arriving from other processes and should therefore
|
||||
|
||||
+29
-6
@@ -47,6 +47,12 @@
|
||||
* with high key binding configurability which requires no application
|
||||
* or toolkit side changes.
|
||||
*
|
||||
* In order for bindings to work in a custom widget implementation, the
|
||||
* widget’s #GtkWidget:can-focus and #GtkWidget:has-focus properties
|
||||
* must both be true. For example, by calling gtk_widget_set_can_focus()
|
||||
* in the widget’s initialisation function; and by calling
|
||||
* gtk_widget_grab_focus() when the widget is clicked.
|
||||
*
|
||||
* # Installing a key binding
|
||||
*
|
||||
* A CSS file binding consists of a “binding-set” definition and a match
|
||||
@@ -69,13 +75,14 @@
|
||||
* movement occurs in 3-character steps), the following binding can be
|
||||
* used:
|
||||
*
|
||||
* |[
|
||||
* |[ <!-- language="CSS" -->
|
||||
* @binding-set MoveCursor3
|
||||
* {
|
||||
* bind "<Control>Right" { "move-cursor" (visual-positions, 3, 0) };
|
||||
* bind "<Control>Left" { "move-cursor" (visual-positions, -3, 0) };
|
||||
* }
|
||||
* GtkEntry
|
||||
*
|
||||
* entry
|
||||
* {
|
||||
* -gtk-key-bindings: MoveCursor3;
|
||||
* }
|
||||
@@ -91,13 +98,14 @@
|
||||
* works as expected. The same mechanism can not be used to “unbind”
|
||||
* existing bindings, however.
|
||||
*
|
||||
* |[
|
||||
* |[ <!-- language="CSS" -->
|
||||
* @binding-set MoveCursor3
|
||||
* {
|
||||
* bind "<Control>Right" { };
|
||||
* bind "<Control>Left" { };
|
||||
* }
|
||||
* GtkEntry
|
||||
*
|
||||
* entry
|
||||
* {
|
||||
* -gtk-key-bindings: MoveCursor3;
|
||||
* }
|
||||
@@ -114,13 +122,14 @@
|
||||
* from activating its default bindings, the “unbind” keyword can be used
|
||||
* like this:
|
||||
*
|
||||
* |[
|
||||
* |[ <!-- language="CSS" -->
|
||||
* @binding-set MoveCursor3
|
||||
* {
|
||||
* unbind "<Control>Right";
|
||||
* unbind "<Control>Left";
|
||||
* }
|
||||
* GtkEntry
|
||||
*
|
||||
* entry
|
||||
* {
|
||||
* -gtk-key-bindings: MoveCursor3;
|
||||
* }
|
||||
@@ -984,6 +993,20 @@ _gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
|
||||
* @binding_set. When the binding is activated, @signal_name will be
|
||||
* emitted on the target widget, with @n_args @Varargs used as
|
||||
* arguments.
|
||||
*
|
||||
* Each argument to the signal must be passed as a pair of varargs: the
|
||||
* #GType of the argument, followed by the argument value (which must
|
||||
* be of the given type). There must be @n_args pairs in total.
|
||||
*
|
||||
* ## Adding a Key Binding
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* gtk_binding_entry_add_signal (binding_set, keyval, modmask,
|
||||
* "move-cursor", 3,
|
||||
* G_TYPE_ENUM, step,
|
||||
* G_TYPE_INT, count,
|
||||
* G_TYPE_BOOLEAN, FALSE);
|
||||
* ]|
|
||||
*/
|
||||
void
|
||||
gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
|
||||
|
||||
+71
-69
@@ -38,9 +38,10 @@ struct _GtkBoxGadgetPrivate {
|
||||
GtkOrientation orientation;
|
||||
GArray *children;
|
||||
|
||||
guint draw_focus : 1;
|
||||
guint draw_reverse : 1;
|
||||
guint draw_focus : 1;
|
||||
guint draw_reverse : 1;
|
||||
guint allocate_reverse : 1;
|
||||
guint align_reverse : 1;
|
||||
};
|
||||
|
||||
typedef gboolean (* ComputeExpandFunc) (GObject *object, GtkOrientation orientation);
|
||||
@@ -48,7 +49,7 @@ typedef gboolean (* ComputeExpandFunc) (GObject *object, GtkOrientation orientat
|
||||
typedef struct _GtkBoxGadgetChild GtkBoxGadgetChild;
|
||||
struct _GtkBoxGadgetChild {
|
||||
GObject *object;
|
||||
ComputeExpandFunc compute_expand;
|
||||
gboolean expand;
|
||||
GtkAlign align;
|
||||
};
|
||||
|
||||
@@ -64,6 +65,21 @@ gtk_box_gadget_child_is_visible (GObject *child)
|
||||
return gtk_css_gadget_get_visible (GTK_CSS_GADGET (child));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_box_gadget_child_compute_expand (GtkBoxGadget *gadget,
|
||||
GtkBoxGadgetChild *child)
|
||||
{
|
||||
GtkBoxGadgetPrivate *priv = gtk_box_gadget_get_instance_private (GTK_BOX_GADGET (gadget));
|
||||
|
||||
if (child->expand)
|
||||
return TRUE;
|
||||
|
||||
if (GTK_IS_WIDGET (child->object))
|
||||
return gtk_widget_compute_expand (GTK_WIDGET (child->object), priv->orientation);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GtkAlign
|
||||
gtk_box_gadget_child_get_align (GtkBoxGadget *gadget,
|
||||
GtkBoxGadgetChild *child)
|
||||
@@ -84,6 +100,21 @@ gtk_box_gadget_child_get_align (GtkBoxGadget *gadget,
|
||||
return align;
|
||||
}
|
||||
|
||||
static GtkAlign
|
||||
effective_align (GtkAlign align,
|
||||
gboolean reverse)
|
||||
{
|
||||
switch (align)
|
||||
{
|
||||
case GTK_ALIGN_START:
|
||||
return reverse ? GTK_ALIGN_END : GTK_ALIGN_START;
|
||||
case GTK_ALIGN_END:
|
||||
return reverse ? GTK_ALIGN_START : GTK_ALIGN_END;
|
||||
default:
|
||||
return align;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_gadget_measure_child (GObject *child,
|
||||
GtkOrientation orientation,
|
||||
@@ -132,7 +163,7 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget,
|
||||
&sizes[i].minimum_size, &sizes[i].natural_size,
|
||||
NULL, NULL);
|
||||
if (gtk_box_gadget_child_is_visible (child->object) &&
|
||||
child->compute_expand (child->object, priv->orientation))
|
||||
gtk_box_gadget_child_compute_expand (gadget, child))
|
||||
n_expand++;
|
||||
size -= sizes[i].minimum_size;
|
||||
}
|
||||
@@ -153,7 +184,7 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget,
|
||||
GtkBoxGadgetChild *child = &g_array_index (priv->children, GtkBoxGadgetChild, i);
|
||||
|
||||
if (!gtk_box_gadget_child_is_visible (child->object) ||
|
||||
!child->compute_expand (child->object, priv->orientation))
|
||||
!gtk_box_gadget_child_compute_expand (gadget, child))
|
||||
continue;
|
||||
|
||||
sizes[i].minimum_size += size / n_expand;
|
||||
@@ -304,6 +335,7 @@ gtk_box_gadget_allocate_child (GObject *child,
|
||||
allocation->width,
|
||||
&minimum, &natural,
|
||||
&minimum_baseline, &natural_baseline);
|
||||
|
||||
switch (child_align)
|
||||
{
|
||||
case GTK_ALIGN_FILL:
|
||||
@@ -407,7 +439,7 @@ gtk_box_gadget_allocate (GtkCssGadget *gadget,
|
||||
child_align = gtk_box_gadget_child_get_align (GTK_BOX_GADGET (gadget), child);
|
||||
gtk_box_gadget_allocate_child (child->object,
|
||||
priv->orientation,
|
||||
child_align,
|
||||
effective_align (child_align, priv->align_reverse),
|
||||
&child_allocation,
|
||||
baseline,
|
||||
&child_clip);
|
||||
@@ -441,7 +473,7 @@ gtk_box_gadget_allocate (GtkCssGadget *gadget,
|
||||
child_align = gtk_box_gadget_child_get_align (GTK_BOX_GADGET (gadget), child);
|
||||
gtk_box_gadget_allocate_child (child->object,
|
||||
priv->orientation,
|
||||
child_align,
|
||||
effective_align (child_align, priv->align_reverse),
|
||||
&child_allocation,
|
||||
-1,
|
||||
&child_clip);
|
||||
@@ -595,6 +627,15 @@ gtk_box_gadget_set_allocate_reverse (GtkBoxGadget *gadget,
|
||||
priv->allocate_reverse = allocate_reverse;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_gadget_set_align_reverse (GtkBoxGadget *gadget,
|
||||
gboolean align_reverse)
|
||||
{
|
||||
GtkBoxGadgetPrivate *priv = gtk_box_gadget_get_instance_private (gadget);
|
||||
|
||||
priv->align_reverse = align_reverse;
|
||||
}
|
||||
|
||||
static GtkCssNode *
|
||||
get_css_node (GObject *child)
|
||||
{
|
||||
@@ -605,17 +646,17 @@ get_css_node (GObject *child)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_gadget_insert_object (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GObject *object,
|
||||
ComputeExpandFunc compute_expand_func,
|
||||
GtkAlign align)
|
||||
gtk_box_gadget_insert_object (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GObject *object,
|
||||
gboolean expand,
|
||||
GtkAlign align)
|
||||
{
|
||||
GtkBoxGadgetPrivate *priv = gtk_box_gadget_get_instance_private (gadget);
|
||||
GtkBoxGadgetChild child;
|
||||
|
||||
child.object = g_object_ref (object);
|
||||
child.compute_expand = compute_expand_func;
|
||||
child.expand = expand;
|
||||
child.align = align;
|
||||
|
||||
if (pos < 0 || pos >= priv->children->len)
|
||||
@@ -635,15 +676,11 @@ gtk_box_gadget_insert_object (GtkBoxGadget *gadget,
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_gadget_insert_widget (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GtkWidget *widget)
|
||||
gtk_box_gadget_insert_widget (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
gtk_box_gadget_insert_object (gadget,
|
||||
pos,
|
||||
G_OBJECT (widget),
|
||||
(ComputeExpandFunc) gtk_widget_compute_expand,
|
||||
GTK_ALIGN_FILL);
|
||||
gtk_box_gadget_insert_object (gadget, pos, G_OBJECT (widget), FALSE, GTK_ALIGN_FILL);
|
||||
}
|
||||
|
||||
static GtkBoxGadgetChild *
|
||||
@@ -692,34 +729,11 @@ gtk_box_gadget_remove_widget (GtkBoxGadget *gadget,
|
||||
gtk_box_gadget_remove_object (gadget, G_OBJECT (widget));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
only_horizontal (GObject *object,
|
||||
GtkOrientation orientation)
|
||||
{
|
||||
return orientation == GTK_ORIENTATION_HORIZONTAL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
only_vertical (GObject *object,
|
||||
GtkOrientation orientation)
|
||||
{
|
||||
return orientation == GTK_ORIENTATION_VERTICAL;
|
||||
}
|
||||
|
||||
static ComputeExpandFunc
|
||||
expand_func_from_flags (gboolean hexpand,
|
||||
gboolean vexpand)
|
||||
{
|
||||
return hexpand ? (vexpand ? (ComputeExpandFunc) gtk_true : only_horizontal)
|
||||
: (vexpand ? only_vertical : (ComputeExpandFunc) gtk_false);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *sibling,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand,
|
||||
gboolean expand,
|
||||
GtkAlign align)
|
||||
{
|
||||
/* Insert at the end if no sibling specified */
|
||||
@@ -728,15 +742,14 @@ gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
|
||||
if (sibling)
|
||||
gtk_box_gadget_find_object (gadget, G_OBJECT (sibling), &pos);
|
||||
|
||||
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, hexpand, vexpand, align);
|
||||
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, expand, align);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *sibling,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand,
|
||||
gboolean expand,
|
||||
GtkAlign align)
|
||||
{
|
||||
/* Insert at the beginning if no sibling specified */
|
||||
@@ -745,25 +758,17 @@ gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
|
||||
if (sibling && gtk_box_gadget_find_object (gadget, G_OBJECT (sibling), &pos))
|
||||
pos++;
|
||||
|
||||
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, hexpand, vexpand, align);
|
||||
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, expand, align);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_gadget_insert_gadget (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand,
|
||||
gboolean expand,
|
||||
GtkAlign align)
|
||||
{
|
||||
ComputeExpandFunc func;
|
||||
|
||||
func = expand_func_from_flags (hexpand, vexpand);
|
||||
gtk_box_gadget_insert_object (gadget,
|
||||
pos,
|
||||
G_OBJECT (cssgadget),
|
||||
func,
|
||||
align);
|
||||
gtk_box_gadget_insert_object (gadget, pos, G_OBJECT (cssgadget), expand, align);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -795,34 +800,31 @@ gtk_box_gadget_reverse_children (GtkBoxGadget *gadget)
|
||||
|
||||
void
|
||||
gtk_box_gadget_set_gadget_expand (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand)
|
||||
GObject *object,
|
||||
gboolean expand)
|
||||
{
|
||||
GtkBoxGadgetChild *child;
|
||||
ComputeExpandFunc func;
|
||||
|
||||
child = gtk_box_gadget_find_object (gadget, G_OBJECT (cssgadget), NULL);
|
||||
child = gtk_box_gadget_find_object (gadget, object, NULL);
|
||||
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
func = expand_func_from_flags (hexpand, vexpand);
|
||||
if (child->compute_expand == func)
|
||||
if (child->expand == expand)
|
||||
return;
|
||||
|
||||
child->compute_expand = func;
|
||||
child->expand = expand;
|
||||
gtk_css_gadget_queue_resize (GTK_CSS_GADGET (gadget));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_gadget_set_gadget_align (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *cssgadget,
|
||||
GObject *object,
|
||||
GtkAlign align)
|
||||
{
|
||||
GtkBoxGadgetChild *child;
|
||||
|
||||
child = gtk_box_gadget_find_object (gadget, G_OBJECT (cssgadget), NULL);
|
||||
child = gtk_box_gadget_find_object (gadget, object, NULL);
|
||||
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
@@ -63,6 +63,8 @@ void gtk_box_gadget_set_draw_reverse (GtkBoxGadget
|
||||
void gtk_box_gadget_set_allocate_reverse (GtkBoxGadget *gadget,
|
||||
gboolean allocate_reverse);
|
||||
|
||||
void gtk_box_gadget_set_align_reverse (GtkBoxGadget *gadget,
|
||||
gboolean align_reverse);
|
||||
void gtk_box_gadget_insert_widget (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GtkWidget *widget);
|
||||
@@ -71,20 +73,17 @@ void gtk_box_gadget_remove_widget (GtkBoxGadget
|
||||
void gtk_box_gadget_insert_gadget (GtkBoxGadget *gadget,
|
||||
int pos,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand,
|
||||
gboolean expand,
|
||||
GtkAlign align);
|
||||
void gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *sibling,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand,
|
||||
gboolean expand,
|
||||
GtkAlign align);
|
||||
void gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *sibling,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand,
|
||||
gboolean expand,
|
||||
GtkAlign align);
|
||||
|
||||
void gtk_box_gadget_remove_gadget (GtkBoxGadget *gadget,
|
||||
@@ -92,11 +91,10 @@ void gtk_box_gadget_remove_gadget (GtkBoxGadget
|
||||
void gtk_box_gadget_reverse_children (GtkBoxGadget *gadget);
|
||||
|
||||
void gtk_box_gadget_set_gadget_expand (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *cssgadget,
|
||||
gboolean hexpand,
|
||||
gboolean vexpand);
|
||||
GObject *object,
|
||||
gboolean expand);
|
||||
void gtk_box_gadget_set_gadget_align (GtkBoxGadget *gadget,
|
||||
GtkCssGadget *cssgadget,
|
||||
GObject *object,
|
||||
GtkAlign align);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+39
-16
@@ -47,6 +47,8 @@ typedef struct _GtkBuiltinIconPrivate GtkBuiltinIconPrivate;
|
||||
struct _GtkBuiltinIconPrivate {
|
||||
GtkCssImageBuiltinType image_type;
|
||||
int default_size;
|
||||
int strikethrough;
|
||||
gboolean strikethrough_valid;
|
||||
char * default_size_property;
|
||||
};
|
||||
|
||||
@@ -63,10 +65,6 @@ gtk_builtin_icon_get_preferred_size (GtkCssGadget *gadget,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkBuiltinIconPrivate *priv = gtk_builtin_icon_get_instance_private (GTK_BUILTIN_ICON (gadget));
|
||||
GtkWidget *widget;
|
||||
PangoContext *pango_context;
|
||||
PangoFontMetrics *metrics;
|
||||
int strikethrough;
|
||||
double min_size;
|
||||
guint property;
|
||||
|
||||
@@ -98,21 +96,33 @@ gtk_builtin_icon_get_preferred_size (GtkCssGadget *gadget,
|
||||
*minimum = *natural = priv->default_size;
|
||||
}
|
||||
|
||||
widget = gtk_css_gadget_get_owner (gadget);
|
||||
|
||||
pango_context = gtk_widget_get_pango_context (widget);
|
||||
metrics = pango_context_get_metrics (pango_context,
|
||||
pango_context_get_font_description (pango_context),
|
||||
pango_context_get_language (pango_context));
|
||||
|
||||
strikethrough = pango_font_metrics_get_strikethrough_position (metrics);
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = *minimum * 0.5 + PANGO_PIXELS (strikethrough);
|
||||
{
|
||||
if (!priv->strikethrough_valid)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
PangoContext *pango_context;
|
||||
const PangoFontDescription *font_desc;
|
||||
PangoFontMetrics *metrics;
|
||||
|
||||
widget = gtk_css_gadget_get_owner (gadget);
|
||||
pango_context = gtk_widget_get_pango_context (widget);
|
||||
font_desc = pango_context_get_font_description (pango_context);
|
||||
|
||||
metrics = pango_context_get_metrics (pango_context,
|
||||
font_desc,
|
||||
pango_context_get_language (pango_context));
|
||||
priv->strikethrough = pango_font_metrics_get_strikethrough_position (metrics);
|
||||
priv->strikethrough_valid = TRUE;
|
||||
|
||||
pango_font_metrics_unref (metrics);
|
||||
}
|
||||
|
||||
*minimum_baseline = *minimum * 0.5 + PANGO_PIXELS (priv->strikethrough);
|
||||
}
|
||||
|
||||
if (natural_baseline)
|
||||
*natural_baseline = *minimum_baseline;
|
||||
|
||||
pango_font_metrics_unref (metrics);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -151,6 +161,18 @@ gtk_builtin_icon_draw (GtkCssGadget *gadget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_builtin_icon_style_changed (GtkCssGadget *gadget,
|
||||
GtkCssStyleChange *change)
|
||||
{
|
||||
GtkBuiltinIconPrivate *priv = gtk_builtin_icon_get_instance_private (GTK_BUILTIN_ICON (gadget));
|
||||
|
||||
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_FONT))
|
||||
priv->strikethrough_valid = FALSE;
|
||||
|
||||
GTK_CSS_GADGET_CLASS (gtk_builtin_icon_parent_class)->style_changed (gadget, change);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_builtin_icon_finalize (GObject *object)
|
||||
{
|
||||
@@ -172,6 +194,7 @@ gtk_builtin_icon_class_init (GtkBuiltinIconClass *klass)
|
||||
gadget_class->get_preferred_size = gtk_builtin_icon_get_preferred_size;
|
||||
gadget_class->allocate = gtk_builtin_icon_allocate;
|
||||
gadget_class->draw = gtk_builtin_icon_draw;
|
||||
gadget_class->style_changed = gtk_builtin_icon_style_changed;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+5
-5
@@ -115,7 +115,7 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
static void gtk_button_destroy (GtkWidget *widget);
|
||||
static void gtk_button_finalize (GObject *object);
|
||||
static void gtk_button_dispose (GObject *object);
|
||||
static void gtk_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
@@ -241,6 +241,7 @@ gtk_button_class_init (GtkButtonClass *klass)
|
||||
|
||||
gobject_class->constructed = gtk_button_constructed;
|
||||
gobject_class->dispose = gtk_button_dispose;
|
||||
gobject_class->finalize = gtk_button_finalize;
|
||||
gobject_class->set_property = gtk_button_set_property;
|
||||
gobject_class->get_property = gtk_button_get_property;
|
||||
|
||||
@@ -249,7 +250,6 @@ gtk_button_class_init (GtkButtonClass *klass)
|
||||
widget_class->get_preferred_width_for_height = gtk_button_get_preferred_width_for_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_button_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_button_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->destroy = gtk_button_destroy;
|
||||
widget_class->screen_changed = gtk_button_screen_changed;
|
||||
widget_class->realize = gtk_button_realize;
|
||||
widget_class->unrealize = gtk_button_unrealize;
|
||||
@@ -755,16 +755,16 @@ gtk_button_init (GtkButton *button)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_destroy (GtkWidget *widget)
|
||||
gtk_button_finalize (GObject *object)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
GtkButton *button = GTK_BUTTON (object);
|
||||
GtkButtonPrivate *priv = button->priv;
|
||||
|
||||
g_clear_pointer (&priv->label_text, g_free);
|
||||
g_clear_object (&priv->gesture);
|
||||
g_clear_object (&priv->gadget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_button_parent_class)->destroy (widget);
|
||||
G_OBJECT_CLASS (gtk_button_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -739,6 +739,8 @@ gtk_cell_editable_event_box_class_init (GtkCellEditableEventBoxClass *class)
|
||||
g_object_class_install_property (object_class, PROP_PATH,
|
||||
g_param_spec_string ("path", NULL, NULL,
|
||||
NULL, GTK_PARAM_READWRITE));
|
||||
|
||||
gtk_widget_class_set_css_name (widget_class, "acceleditor");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -2024,6 +2024,7 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
|
||||
|
||||
gtk_entry_set_has_frame (GTK_ENTRY (priv->entry), FALSE);
|
||||
gtk_entry_set_alignment (GTK_ENTRY (priv->entry), xalign);
|
||||
gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 5);
|
||||
|
||||
if (priv->text)
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->entry), priv->text);
|
||||
|
||||
@@ -127,11 +127,11 @@ gtk_check_button_update_node_state (GtkWidget *widget)
|
||||
* way to update the icon
|
||||
*/
|
||||
if (state & GTK_STATE_FLAG_CHECKED)
|
||||
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED : GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED;
|
||||
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION : GTK_CSS_IMAGE_BUILTIN_CHECK;
|
||||
else if (state & GTK_STATE_FLAG_INCONSISTENT)
|
||||
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT : GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT;
|
||||
else
|
||||
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION : GTK_CSS_IMAGE_BUILTIN_CHECK;
|
||||
image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
|
||||
gtk_builtin_icon_set_image (GTK_BUILTIN_ICON (priv->indicator_gadget), image_type);
|
||||
|
||||
gtk_css_gadget_set_state (priv->indicator_gadget, state);
|
||||
@@ -156,6 +156,8 @@ gtk_check_button_direction_changed (GtkWidget *widget,
|
||||
gtk_box_gadget_reverse_children (GTK_BOX_GADGET (priv->gadget));
|
||||
gtk_box_gadget_set_allocate_reverse (GTK_BOX_GADGET (priv->gadget),
|
||||
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
|
||||
gtk_box_gadget_set_align_reverse (GTK_BOX_GADGET (priv->gadget),
|
||||
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_check_button_parent_class)->direction_changed (widget, previous_direction);
|
||||
}
|
||||
@@ -182,6 +184,7 @@ gtk_check_button_add (GtkContainer *container,
|
||||
|
||||
pos = gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL ? 0 : 1;
|
||||
gtk_box_gadget_insert_widget (GTK_BOX_GADGET (priv->gadget), pos, widget);
|
||||
gtk_box_gadget_set_gadget_expand (GTK_BOX_GADGET (priv->gadget), G_OBJECT (widget), TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -322,7 +325,7 @@ gtk_check_button_init (GtkCheckButton *check_button)
|
||||
priv->gadget,
|
||||
NULL);
|
||||
gtk_builtin_icon_set_default_size_property (GTK_BUILTIN_ICON (priv->indicator_gadget), "indicator-size");
|
||||
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), 0, priv->indicator_gadget, FALSE, FALSE, GTK_ALIGN_BASELINE);
|
||||
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), 0, priv->indicator_gadget, FALSE, GTK_ALIGN_BASELINE);
|
||||
|
||||
gtk_check_button_update_node_state (GTK_WIDGET (check_button));
|
||||
}
|
||||
|
||||
@@ -373,10 +373,10 @@ gtk_color_editor_init (GtkColorEditor *editor)
|
||||
|
||||
if (gtk_widget_get_direction (editor->priv->h_slider) == GTK_TEXT_DIR_RTL)
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (editor->priv->h_slider),
|
||||
GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
|
||||
"marks-before");
|
||||
else
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (editor->priv->h_slider),
|
||||
GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
|
||||
"marks-after");
|
||||
|
||||
/* Create the scaled popup adjustments manually here because connecting user data is not
|
||||
* supported by template GtkBuilder xml (it would be possible to set this up in the xml
|
||||
|
||||
+27
-10
@@ -116,7 +116,7 @@
|
||||
* ]|
|
||||
*
|
||||
* A GtkComboBox with an entry has a single CSS node with name combobox. It
|
||||
* contains a bx with the .linked class and that box contains an entry and a
|
||||
* contains a box with the .linked class. That box contains an entry and a
|
||||
* button, both with the .combo class added.
|
||||
* The button also contains another node with name arrow.
|
||||
*/
|
||||
@@ -276,6 +276,7 @@ static void gtk_combo_box_cell_editable_init (GtkCellEditableIface *iface)
|
||||
static void gtk_combo_box_constructed (GObject *object);
|
||||
static void gtk_combo_box_dispose (GObject *object);
|
||||
static void gtk_combo_box_finalize (GObject *object);
|
||||
static void gtk_combo_box_unmap (GtkWidget *widget);
|
||||
static void gtk_combo_box_destroy (GtkWidget *widget);
|
||||
|
||||
static void gtk_combo_box_set_property (GObject *object,
|
||||
@@ -705,6 +706,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
|
||||
widget_class->get_preferred_height = gtk_combo_box_get_preferred_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_combo_box_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_width_for_height = gtk_combo_box_get_preferred_width_for_height;
|
||||
widget_class->unmap = gtk_combo_box_unmap;
|
||||
widget_class->destroy = gtk_combo_box_destroy;
|
||||
widget_class->compute_expand = gtk_combo_box_compute_expand;
|
||||
|
||||
@@ -2304,15 +2306,15 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box,
|
||||
guint32 activate_time)
|
||||
{
|
||||
GtkComboBoxPrivate *priv = combo_box->priv;
|
||||
GtkTreePath *path;
|
||||
gint active_item;
|
||||
gint width, min_width, nat_width;
|
||||
|
||||
update_menu_sensitivity (combo_box, priv->popup_widget);
|
||||
|
||||
active_item = -1;
|
||||
if (gtk_tree_row_reference_valid (priv->active_row))
|
||||
{
|
||||
GtkTreePath *path;
|
||||
|
||||
path = gtk_tree_row_reference_get_path (priv->active_row);
|
||||
active_item = gtk_tree_path_get_indices (path)[0];
|
||||
gtk_tree_path_free (path);
|
||||
@@ -2327,6 +2329,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box,
|
||||
if (priv->wrap_width == 0)
|
||||
{
|
||||
GtkAllocation content_allocation;
|
||||
gint width, min_width, nat_width;
|
||||
|
||||
gtk_css_gadget_get_content_allocation (priv->gadget, &content_allocation, NULL);
|
||||
width = content_allocation.width;
|
||||
@@ -2384,6 +2387,8 @@ gtk_combo_box_grab_broken_event (GtkWidget *widget,
|
||||
* This function is mostly intended for use by accessibility technologies;
|
||||
* applications should have little use for it.
|
||||
*
|
||||
* Before calling this, @combo_box must be mapped, or nothing will happen.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
void
|
||||
@@ -2391,7 +2396,8 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
|
||||
|
||||
g_signal_emit (combo_box, combo_box_signals[POPUP], 0);
|
||||
if (gtk_widget_get_mapped (GTK_WIDGET (combo_box)))
|
||||
g_signal_emit (combo_box, combo_box_signals[POPUP], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2409,7 +2415,7 @@ void
|
||||
gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
|
||||
GdkDevice *device)
|
||||
{
|
||||
GtkComboBoxPrivate *priv = combo_box->priv;
|
||||
GtkComboBoxPrivate *priv;
|
||||
gint x, y, width, height;
|
||||
GtkTreePath *path = NULL, *ppath;
|
||||
GtkWidget *toplevel;
|
||||
@@ -2418,6 +2424,8 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
|
||||
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
|
||||
priv = combo_box->priv;
|
||||
|
||||
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
|
||||
return;
|
||||
|
||||
@@ -2539,10 +2547,12 @@ gtk_combo_box_real_popdown (GtkComboBox *combo_box)
|
||||
void
|
||||
gtk_combo_box_popdown (GtkComboBox *combo_box)
|
||||
{
|
||||
GtkComboBoxPrivate *priv = combo_box->priv;
|
||||
GtkComboBoxPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
|
||||
|
||||
priv = combo_box->priv;
|
||||
|
||||
if (GTK_IS_MENU (priv->popup_widget))
|
||||
{
|
||||
gtk_menu_popdown (GTK_MENU (priv->popup_widget));
|
||||
@@ -4071,7 +4081,7 @@ gtk_combo_box_set_model (GtkComboBox *combo_box,
|
||||
|
||||
priv = combo_box->priv;
|
||||
|
||||
if (model == combo_box->priv->model)
|
||||
if (model == priv->model)
|
||||
return;
|
||||
|
||||
gtk_combo_box_unset_model (combo_box);
|
||||
@@ -4272,6 +4282,14 @@ gtk_combo_box_grab_focus (GtkWidget *widget)
|
||||
gtk_widget_grab_focus (combo_box->priv->button);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_box_unmap (GtkWidget *widget)
|
||||
{
|
||||
gtk_combo_box_popdown (GTK_COMBO_BOX (widget));
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->unmap (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_box_destroy (GtkWidget *widget)
|
||||
{
|
||||
@@ -4297,8 +4315,6 @@ gtk_combo_box_destroy (GtkWidget *widget)
|
||||
_gtk_bin_set_child (GTK_BIN (combo_box), NULL);
|
||||
}
|
||||
|
||||
gtk_combo_box_popdown (combo_box);
|
||||
|
||||
if (priv->row_separator_destroy)
|
||||
priv->row_separator_destroy (priv->row_separator_data);
|
||||
|
||||
@@ -4955,11 +4971,12 @@ void
|
||||
gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box,
|
||||
gint text_column)
|
||||
{
|
||||
GtkComboBoxPrivate *priv = combo_box->priv;
|
||||
GtkComboBoxPrivate *priv;
|
||||
GtkTreeModel *model;
|
||||
|
||||
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
|
||||
|
||||
priv = combo_box->priv;
|
||||
model = gtk_combo_box_get_model (combo_box);
|
||||
|
||||
g_return_if_fail (text_column >= 0);
|
||||
|
||||
@@ -573,7 +573,9 @@ gtk_compose_table_serialize (GtkComposeTable *compose_table,
|
||||
(long long) (p - contents), total_length); \
|
||||
g_free (contents); \
|
||||
if (count) \
|
||||
*count = 0; \
|
||||
{ \
|
||||
*count = 0; \
|
||||
} \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,16 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
|
||||
if (value->y)
|
||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
|
||||
|
||||
if (x == value->x && y == value->y)
|
||||
{
|
||||
if (x)
|
||||
_gtk_css_value_unref (x);
|
||||
if (y)
|
||||
_gtk_css_value_unref (y);
|
||||
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
|
||||
value->y ? y : NULL);
|
||||
}
|
||||
|
||||
+11
-6
@@ -48,28 +48,33 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *values[4];
|
||||
GtkCssValue *computed;
|
||||
gboolean changed = FALSE;
|
||||
guint i;
|
||||
|
||||
computed = _gtk_css_border_value_new (NULL, NULL, NULL, NULL);
|
||||
computed->fill = value->fill;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (value->values[i])
|
||||
{
|
||||
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
changed |= (computed->values[i] != value->values[i]);
|
||||
values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
changed |= (values[i] != value->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!changed)
|
||||
{
|
||||
_gtk_css_value_unref (computed);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (values[i] != NULL)
|
||||
_gtk_css_value_unref (values[i]);
|
||||
}
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
computed = _gtk_css_border_value_new (values[0], values[1], values[2], values[3]);
|
||||
computed->fill = value->fill;
|
||||
|
||||
return computed;
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -890,7 +890,8 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
|
||||
#if G_ENABLE_DEBUG
|
||||
{
|
||||
GdkDisplay *display = gtk_widget_get_display (gtk_css_gadget_get_owner (gadget));
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (display, LAYOUT))
|
||||
GtkDebugFlag flags = gtk_get_display_debug_flags (display);
|
||||
if G_UNLIKELY (flags & GTK_DEBUG_LAYOUT)
|
||||
{
|
||||
cairo_save (cr);
|
||||
cairo_new_path (cr);
|
||||
@@ -912,7 +913,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
|
||||
cairo_stroke (cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
if (GTK_DISPLAY_DEBUG_CHECK (display, BASELINES))
|
||||
if G_UNLIKELY (flags & GTK_DEBUG_BASELINES)
|
||||
{
|
||||
int baseline = priv->allocated_baseline;
|
||||
|
||||
@@ -926,7 +927,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
|
||||
}
|
||||
cairo_save (cr);
|
||||
cairo_new_path (cr);
|
||||
cairo_move_to (cr, x + margin.left, priv->allocated_baseline + 0.5);
|
||||
cairo_move_to (cr, x + margin.left, baseline + 0.5);
|
||||
cairo_rel_line_to (cr, width - margin.left - margin.right, 0);
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_set_source_rgba (cr, 1.0, 0, 0.25, 0.25);
|
||||
|
||||
+16
-87
@@ -45,39 +45,22 @@ gtk_css_image_builtin_draw_check (GtkCssImage *image,
|
||||
gboolean inconsistent)
|
||||
{
|
||||
GtkCssImageBuiltin *builtin = GTK_CSS_IMAGE_BUILTIN (image);
|
||||
gint x, y, exterior_size, interior_size, thickness, pad;
|
||||
gint x, y, exterior_size, interior_size, pad;
|
||||
|
||||
exterior_size = MIN (width, height);
|
||||
|
||||
if (exterior_size % 2 == 0) /* Ensure odd */
|
||||
exterior_size -= 1;
|
||||
|
||||
/* FIXME: thickness */
|
||||
thickness = 1;
|
||||
pad = thickness + MAX (1, (exterior_size - 2 * thickness) / 9);
|
||||
pad = 1 + MAX (1, (exterior_size - 2) / 9);
|
||||
interior_size = MAX (1, exterior_size - 2 * pad);
|
||||
|
||||
if (interior_size < 7)
|
||||
{
|
||||
interior_size = 7;
|
||||
pad = MAX (0, (exterior_size - interior_size) / 2);
|
||||
}
|
||||
pad = MAX (0, (exterior_size - interior_size) / 2);
|
||||
|
||||
x = - (1 + exterior_size - (gint) width) / 2;
|
||||
y = - (1 + exterior_size - (gint) height) / 2;
|
||||
|
||||
if (builtin->border_width > 0)
|
||||
{
|
||||
cairo_set_line_width (cr, builtin->border_width);
|
||||
|
||||
cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->bg_color);
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->border_color);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
|
||||
|
||||
if (inconsistent)
|
||||
@@ -95,6 +78,7 @@ gtk_css_image_builtin_draw_check (GtkCssImage *image,
|
||||
{
|
||||
if (checked)
|
||||
{
|
||||
cairo_save (cr);
|
||||
cairo_translate (cr,
|
||||
x + pad, y + pad);
|
||||
|
||||
@@ -123,6 +107,7 @@ gtk_css_image_builtin_draw_check (GtkCssImage *image,
|
||||
7.0, 0.0);
|
||||
|
||||
cairo_fill (cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +121,7 @@ gtk_css_image_builtin_draw_option (GtkCssImage *image,
|
||||
gboolean inconsistent)
|
||||
{
|
||||
GtkCssImageBuiltin *builtin = GTK_CSS_IMAGE_BUILTIN (image);
|
||||
gint x, y, exterior_size, interior_size, thickness, pad;
|
||||
gint x, y, exterior_size, interior_size, pad;
|
||||
|
||||
exterior_size = MIN (width, height);
|
||||
|
||||
@@ -146,42 +131,18 @@ gtk_css_image_builtin_draw_option (GtkCssImage *image,
|
||||
x = - (1 + exterior_size - width) / 2;
|
||||
y = - (1 + exterior_size - height) / 2;
|
||||
|
||||
if (builtin->border_width > 0)
|
||||
{
|
||||
cairo_set_line_width (cr, builtin->border_width);
|
||||
|
||||
cairo_new_sub_path (cr);
|
||||
cairo_arc (cr,
|
||||
x + exterior_size / 2.,
|
||||
y + exterior_size / 2.,
|
||||
(exterior_size - 1) / 2.,
|
||||
0, 2 * G_PI);
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->bg_color);
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->border_color);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
|
||||
|
||||
/* FIXME: thickness */
|
||||
thickness = 1;
|
||||
pad = 1 + MAX (1, 2 * (exterior_size - 2) / 9);
|
||||
interior_size = MAX (1, exterior_size - 2 * pad);
|
||||
|
||||
if (interior_size < 7)
|
||||
pad = MAX (0, (exterior_size - interior_size) / 2);
|
||||
|
||||
if (inconsistent)
|
||||
{
|
||||
gint line_thickness;
|
||||
|
||||
pad = thickness + MAX (1, (exterior_size - 2 * thickness) / 9);
|
||||
interior_size = MAX (1, exterior_size - 2 * pad);
|
||||
|
||||
if (interior_size < 7)
|
||||
{
|
||||
interior_size = 7;
|
||||
pad = MAX (0, (exterior_size - interior_size) / 2);
|
||||
}
|
||||
|
||||
line_thickness = MAX (1, (3 + interior_size * 2) / 7);
|
||||
|
||||
cairo_rectangle (cr,
|
||||
@@ -191,17 +152,8 @@ gtk_css_image_builtin_draw_option (GtkCssImage *image,
|
||||
line_thickness);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
if (checked)
|
||||
else if (checked)
|
||||
{
|
||||
pad = thickness + MAX (1, 2 * (exterior_size - 2 * thickness) / 9);
|
||||
interior_size = MAX (1, exterior_size - 2 * pad);
|
||||
|
||||
if (interior_size < 5)
|
||||
{
|
||||
interior_size = 7;
|
||||
pad = MAX (0, (exterior_size - interior_size) / 2);
|
||||
}
|
||||
|
||||
cairo_new_sub_path (cr);
|
||||
cairo_arc (cr,
|
||||
x + pad + interior_size / 2.,
|
||||
@@ -353,10 +305,7 @@ gtk_css_image_builtin_draw_expander (GtkCssImage *image,
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
|
||||
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
gdk_cairo_set_source_rgba (cr, &builtin->border_color);
|
||||
cairo_stroke (cr);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -809,27 +758,11 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageBuiltin *result;
|
||||
GtkBorderStyle border_style;
|
||||
|
||||
result = g_object_new (GTK_TYPE_CSS_IMAGE_BUILTIN, NULL);
|
||||
|
||||
border_style = _gtk_css_border_style_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_STYLE));
|
||||
if (border_style == GTK_BORDER_STYLE_SOLID)
|
||||
{
|
||||
GtkBorder border;
|
||||
|
||||
border.top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
|
||||
border.right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
|
||||
border.bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
|
||||
border.left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
|
||||
|
||||
result->border_width = MIN (MIN (border.top, border.bottom),
|
||||
MIN (border.left, border.right));
|
||||
}
|
||||
|
||||
result->fg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
|
||||
result->bg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
|
||||
result->border_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
|
||||
|
||||
return GTK_CSS_IMAGE (result);
|
||||
}
|
||||
@@ -842,9 +775,7 @@ gtk_css_image_builtin_equal (GtkCssImage *image1,
|
||||
GtkCssImageBuiltin *builtin2 = GTK_CSS_IMAGE_BUILTIN (image2);
|
||||
|
||||
return gdk_rgba_equal (&builtin1->fg_color, &builtin2->fg_color)
|
||||
&& gdk_rgba_equal (&builtin1->bg_color, &builtin2->bg_color)
|
||||
&& gdk_rgba_equal (&builtin1->border_color, &builtin2->border_color)
|
||||
&& builtin1->border_width == builtin2->border_width;
|
||||
&& gdk_rgba_equal (&builtin1->bg_color, &builtin2->bg_color);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -912,19 +843,17 @@ gtk_css_image_builtin_draw (GtkCssImage *image,
|
||||
case GTK_CSS_IMAGE_BUILTIN_NONE:
|
||||
break;
|
||||
case GTK_CSS_IMAGE_BUILTIN_CHECK:
|
||||
case GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED:
|
||||
case GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT:
|
||||
gtk_css_image_builtin_draw_check (image, cr,
|
||||
width, height,
|
||||
image_type == GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED,
|
||||
image_type == GTK_CSS_IMAGE_BUILTIN_CHECK,
|
||||
image_type == GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT);
|
||||
break;
|
||||
case GTK_CSS_IMAGE_BUILTIN_OPTION:
|
||||
case GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED:
|
||||
case GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT:
|
||||
gtk_css_image_builtin_draw_option (image, cr,
|
||||
width, height,
|
||||
image_type == GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED,
|
||||
image_type == GTK_CSS_IMAGE_BUILTIN_OPTION,
|
||||
image_type == GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT);
|
||||
break;
|
||||
case GTK_CSS_IMAGE_BUILTIN_ARROW_UP:
|
||||
|
||||
@@ -41,8 +41,6 @@ struct _GtkCssImageBuiltin
|
||||
|
||||
GdkRGBA fg_color;
|
||||
GdkRGBA bg_color;
|
||||
GdkRGBA border_color;
|
||||
int border_width;
|
||||
};
|
||||
|
||||
struct _GtkCssImageBuiltinClass
|
||||
|
||||
@@ -227,6 +227,27 @@ gtk_css_image_cross_fade_print (GtkCssImage *image,
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_cross_fade_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);
|
||||
GtkCssImage *start, *end, *computed;
|
||||
|
||||
start = _gtk_css_image_compute (cross_fade->start, property_id, provider, style, parent_style);
|
||||
end = _gtk_css_image_compute (cross_fade->end, property_id, provider, style, parent_style);
|
||||
|
||||
computed = _gtk_css_image_cross_fade_new (start, end, cross_fade->progress);
|
||||
|
||||
g_object_unref (start);
|
||||
g_object_unref (end);
|
||||
|
||||
return computed;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_image_cross_fade_dispose (GObject *object)
|
||||
{
|
||||
@@ -250,6 +271,7 @@ _gtk_css_image_cross_fade_class_init (GtkCssImageCrossFadeClass *klass)
|
||||
image_class->draw = gtk_css_image_cross_fade_draw;
|
||||
image_class->parse = gtk_css_image_cross_fade_parse;
|
||||
image_class->print = gtk_css_image_cross_fade_print;
|
||||
image_class->compute = gtk_css_image_cross_fade_compute;
|
||||
|
||||
object_class->dispose = gtk_css_image_cross_fade_dispose;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ gtk_css_image_fallback_draw (GtkCssImage *image,
|
||||
if (fallback->color)
|
||||
gdk_cairo_set_source_rgba (cr, _gtk_css_rgba_value_get_rgba (fallback->color));
|
||||
else
|
||||
cairo_set_source_rgb (cr, 1, 0, 9);
|
||||
cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
|
||||
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_fill (cr);
|
||||
@@ -85,7 +85,7 @@ gtk_css_image_fallback_draw (GtkCssImage *image,
|
||||
|
||||
static void
|
||||
gtk_css_image_fallback_print (GtkCssImage *image,
|
||||
GString *string)
|
||||
GString *string)
|
||||
{
|
||||
GtkCssImageFallback *fallback = GTK_CSS_IMAGE_FALLBACK (image);
|
||||
int i;
|
||||
|
||||
@@ -593,6 +593,10 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
|
||||
_gtk_marshal_VOID__OBJECT_OBJECT,
|
||||
G_TYPE_NONE, 2,
|
||||
GTK_TYPE_CSS_NODE, GTK_TYPE_CSS_NODE);
|
||||
g_signal_set_va_marshaller (cssnode_signals[NODE_ADDED],
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
_gtk_marshal_VOID__OBJECT_OBJECTv);
|
||||
|
||||
cssnode_signals[NODE_REMOVED] =
|
||||
g_signal_new (I_("node-removed"),
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
@@ -602,6 +606,10 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
|
||||
_gtk_marshal_VOID__OBJECT_OBJECT,
|
||||
G_TYPE_NONE, 2,
|
||||
GTK_TYPE_CSS_NODE, GTK_TYPE_CSS_NODE);
|
||||
g_signal_set_va_marshaller (cssnode_signals[NODE_REMOVED],
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
_gtk_marshal_VOID__OBJECT_OBJECTv);
|
||||
|
||||
cssnode_signals[STYLE_CHANGED] =
|
||||
g_signal_new (I_("style-changed"),
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
@@ -611,6 +619,9 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
|
||||
_gtk_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_POINTER);
|
||||
g_signal_set_va_marshaller (cssnode_signals[STYLE_CHANGED],
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
_gtk_marshal_VOID__POINTERv);
|
||||
|
||||
cssnode_properties[PROP_CLASSES] =
|
||||
g_param_spec_boxed ("classes", P_("Style Classes"), P_("List of classes"),
|
||||
|
||||
@@ -1484,11 +1484,11 @@ parse_declaration (GtkCssScanner *scanner,
|
||||
!_gtk_css_parser_begins_with (scanner->parser, '}') &&
|
||||
!_gtk_css_parser_is_eof (scanner->parser))
|
||||
{
|
||||
gtk_css_provider_error_literal (scanner->provider,
|
||||
scanner,
|
||||
GTK_CSS_PROVIDER_ERROR,
|
||||
GTK_CSS_PROVIDER_ERROR_SYNTAX,
|
||||
"Junk at end of value");
|
||||
gtk_css_provider_error (scanner->provider,
|
||||
scanner,
|
||||
GTK_CSS_PROVIDER_ERROR,
|
||||
GTK_CSS_PROVIDER_ERROR_SYNTAX,
|
||||
"Junk at end of value for %s", property->name);
|
||||
_gtk_css_parser_resync (scanner->parser, TRUE, '}');
|
||||
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_VALUE);
|
||||
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_DECLARATION);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user