detached 759f3c2

build(gen) regenerate bindings with bug fixes

Partial regeneration - needs final go generate after GStrdup path fix
commit
759f3c2e4fb7a30d0b0cbd8bad604614897418db
author
bnema · · 2026-02-06 22:40 UTC
parent
53bd89c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
175 files · +3526 -1566
M v4/adw/adw-about-dialog.go +7 -3
@@ -1721,10 +1721,12 @@ func (x *AboutDialog) GetPropertyWebsite() string {
1721 //1721 //
1722 // Applications may connect to it to override the default behavior, which is1722 // Applications may connect to it to override the default behavior, which is
1723 // to call [func@Gtk.show_uri].1723 // to call [func@Gtk.show_uri].
1724-func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) uint32 {1724+func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) uint {
1725 cbPtr := uintptr(unsafe.Pointer(cb))1725 cbPtr := uintptr(unsafe.Pointer(cb))
1726 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1726 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1727- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)1727+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
1728+ glib.SaveHandlerMapping(handlerID, cbPtr)
1729+ return handlerID
1728 }1730 }
1729 1731
1730 fcb := func(clsPtr uintptr, UriVarp string) bool {1732 fcb := func(clsPtr uintptr, UriVarp string) bool {
@@ -1737,7 +1739,9 @@ func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) ui
1737 }1739 }
1738 cbRefPtr := purego.NewCallback(fcb)1740 cbRefPtr := purego.NewCallback(fcb)
1739 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1741 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1740- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)1742+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
1743+ glib.SaveHandlerMapping(handlerID, cbPtr)
1744+ return handlerID
1741 }1745 }
1742 1746
1743 // Requests the user's screen reader to announce the given message.1747 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-about-window.go +7 -3
@@ -1691,10 +1691,12 @@ func (x *AboutWindow) GetPropertyWebsite() string {
1691 //1691 //
1692 // Applications may connect to it to override the default behavior, which is1692 // Applications may connect to it to override the default behavior, which is
1693 // to call [func@Gtk.show_uri].1693 // to call [func@Gtk.show_uri].
1694-func (x *AboutWindow) ConnectActivateLink(cb *func(AboutWindow, string) bool) uint32 {1694+func (x *AboutWindow) ConnectActivateLink(cb *func(AboutWindow, string) bool) uint {
1695 cbPtr := uintptr(unsafe.Pointer(cb))1695 cbPtr := uintptr(unsafe.Pointer(cb))
1696 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1696 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1697- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)1697+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
1698+ glib.SaveHandlerMapping(handlerID, cbPtr)
1699+ return handlerID
1698 }1700 }
1699 1701
1700 fcb := func(clsPtr uintptr, UriVarp string) bool {1702 fcb := func(clsPtr uintptr, UriVarp string) bool {
@@ -1707,7 +1709,9 @@ func (x *AboutWindow) ConnectActivateLink(cb *func(AboutWindow, string) bool) ui
1707 }1709 }
1708 cbRefPtr := purego.NewCallback(fcb)1710 cbRefPtr := purego.NewCallback(fcb)
1709 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1711 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1710- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)1712+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
1713+ glib.SaveHandlerMapping(handlerID, cbPtr)
1714+ return handlerID
1711 }1715 }
1712 1716
1713 // Requests the user's screen reader to announce the given message.1717 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-action-row.go +7 -3
@@ -436,10 +436,12 @@ func (x *ActionRow) GetPropertyTitleLines() int {
436 }436 }
437 437
438 // This signal is emitted after the row has been activated.438 // This signal is emitted after the row has been activated.
439-func (x *ActionRow) ConnectActivated(cb *func(ActionRow)) uint32 {439+func (x *ActionRow) ConnectActivated(cb *func(ActionRow)) uint {
440 cbPtr := uintptr(unsafe.Pointer(cb))440 cbPtr := uintptr(unsafe.Pointer(cb))
441 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {441 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
442- return gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)442+ handlerID := gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)
443+ glib.SaveHandlerMapping(handlerID, cbPtr)
444+ return handlerID
443 }445 }
444 446
445 fcb := func(clsPtr uintptr) {447 fcb := func(clsPtr uintptr) {
@@ -452,7 +454,9 @@ func (x *ActionRow) ConnectActivated(cb *func(ActionRow)) uint32 {
452 }454 }
453 cbRefPtr := purego.NewCallback(fcb)455 cbRefPtr := purego.NewCallback(fcb)
454 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)456 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
455- return gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)457+ handlerID := gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)
458+ glib.SaveHandlerMapping(handlerID, cbPtr)
459+ return handlerID
456 }460 }
457 461
458 // Requests the user's screen reader to announce the given message.462 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-alert-dialog.go +14 -6
@@ -901,10 +901,12 @@ func (x *AlertDialog) GetPropertyPreferWideLayout() bool {
901 // if the dialog was closed by pressing <kbd>Escape</kbd> or with a system901 // if the dialog was closed by pressing <kbd>Escape</kbd> or with a system
902 // action, @response will be set to the value of902 // action, @response will be set to the value of
903 // [property@AlertDialog:close-response].903 // [property@AlertDialog:close-response].
904-func (x *AlertDialog) ConnectResponse(cb *func(AlertDialog, string)) uint32 {904+func (x *AlertDialog) ConnectResponse(cb *func(AlertDialog, string)) uint {
905 cbPtr := uintptr(unsafe.Pointer(cb))905 cbPtr := uintptr(unsafe.Pointer(cb))
906 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {906 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
907- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)907+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
908+ glib.SaveHandlerMapping(handlerID, cbPtr)
909+ return handlerID
908 }910 }
909 911
910 fcb := func(clsPtr uintptr, ResponseVarp string) {912 fcb := func(clsPtr uintptr, ResponseVarp string) {
@@ -917,16 +919,20 @@ func (x *AlertDialog) ConnectResponse(cb *func(AlertDialog, string)) uint32 {
917 }919 }
918 cbRefPtr := purego.NewCallback(fcb)920 cbRefPtr := purego.NewCallback(fcb)
919 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)921 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
920- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)922+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
923+ glib.SaveHandlerMapping(handlerID, cbPtr)
924+ return handlerID
921 }925 }
922 926
923 // ConnectResponseWithDetail connects to the "response" signal with a detail string.927 // ConnectResponseWithDetail connects to the "response" signal with a detail string.
924 // The detail is appended as "response::<detail>".928 // The detail is appended as "response::<detail>".
925-func (x *AlertDialog) ConnectResponseWithDetail(detail string, cb *func(AlertDialog, string)) uint32 {929+func (x *AlertDialog) ConnectResponseWithDetail(detail string, cb *func(AlertDialog, string)) uint {
926 cbPtr := uintptr(unsafe.Pointer(cb))930 cbPtr := uintptr(unsafe.Pointer(cb))
927 signalName := fmt.Sprintf("response::%s", detail)931 signalName := fmt.Sprintf("response::%s", detail)
928 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {932 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
929- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)933+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
934+ glib.SaveHandlerMapping(handlerID, cbPtr)
935+ return handlerID
930 }936 }
931 937
932 fcb := func(clsPtr uintptr, ResponseVarp string) {938 fcb := func(clsPtr uintptr, ResponseVarp string) {
@@ -939,7 +945,9 @@ func (x *AlertDialog) ConnectResponseWithDetail(detail string, cb *func(AlertDia
939 }945 }
940 cbRefPtr := purego.NewCallback(fcb)946 cbRefPtr := purego.NewCallback(fcb)
941 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)947 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
942- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)948+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
949+ glib.SaveHandlerMapping(handlerID, cbPtr)
950+ return handlerID
943 }951 }
944 952
945 // Requests the user's screen reader to announce the given message.953 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-animation.go +7 -3
@@ -348,10 +348,12 @@ func (x *Animation) GetPropertyValue() float64 {
348 348
349 // This signal is emitted when the animation has been completed, either on its349 // This signal is emitted when the animation has been completed, either on its
350 // own or via calling [method@Animation.skip].350 // own or via calling [method@Animation.skip].
351-func (x *Animation) ConnectDone(cb *func(Animation)) uint32 {351+func (x *Animation) ConnectDone(cb *func(Animation)) uint {
352 cbPtr := uintptr(unsafe.Pointer(cb))352 cbPtr := uintptr(unsafe.Pointer(cb))
353 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {353 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
354- return gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)354+ handlerID := gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)
355+ glib.SaveHandlerMapping(handlerID, cbPtr)
356+ return handlerID
355 }357 }
356 358
357 fcb := func(clsPtr uintptr) {359 fcb := func(clsPtr uintptr) {
@@ -364,7 +366,9 @@ func (x *Animation) ConnectDone(cb *func(Animation)) uint32 {
364 }366 }
365 cbRefPtr := purego.NewCallback(fcb)367 cbRefPtr := purego.NewCallback(fcb)
366 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)368 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
367- return gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)369+ handlerID := gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)
370+ glib.SaveHandlerMapping(handlerID, cbPtr)
371+ return handlerID
368 }372 }
369 373
370 func init() {374 func init() {
M v4/adw/adw-banner.go +7 -3
@@ -328,10 +328,12 @@ func (x *Banner) GetPropertyUseMarkup() bool {
328 // This signal is emitted after the action button has been clicked.328 // This signal is emitted after the action button has been clicked.
329 //329 //
330 // It can be used as an alternative to setting an action.330 // It can be used as an alternative to setting an action.
331-func (x *Banner) ConnectButtonClicked(cb *func(Banner)) uint32 {331+func (x *Banner) ConnectButtonClicked(cb *func(Banner)) uint {
332 cbPtr := uintptr(unsafe.Pointer(cb))332 cbPtr := uintptr(unsafe.Pointer(cb))
333 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {333 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
334- return gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)334+ handlerID := gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)
335+ glib.SaveHandlerMapping(handlerID, cbPtr)
336+ return handlerID
335 }337 }
336 338
337 fcb := func(clsPtr uintptr) {339 fcb := func(clsPtr uintptr) {
@@ -344,7 +346,9 @@ func (x *Banner) ConnectButtonClicked(cb *func(Banner)) uint32 {
344 }346 }
345 cbRefPtr := purego.NewCallback(fcb)347 cbRefPtr := purego.NewCallback(fcb)
346 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)348 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
347- return gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)349+ handlerID := gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)
350+ glib.SaveHandlerMapping(handlerID, cbPtr)
351+ return handlerID
348 }352 }
349 353
350 // Requests the user's screen reader to announce the given message.354 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-bottom-sheet.go +7 -3
@@ -677,10 +677,12 @@ func (x *BottomSheet) GetPropertyShowDragHandle() bool {
677 677
678 // Emitted when the close button or shortcut is used while678 // Emitted when the close button or shortcut is used while
679 // [property@Dialog:can-close] is set to `FALSE`.679 // [property@Dialog:can-close] is set to `FALSE`.
680-func (x *BottomSheet) ConnectCloseAttempt(cb *func(BottomSheet)) uint32 {680+func (x *BottomSheet) ConnectCloseAttempt(cb *func(BottomSheet)) uint {
681 cbPtr := uintptr(unsafe.Pointer(cb))681 cbPtr := uintptr(unsafe.Pointer(cb))
682 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {682 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
683- return gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)683+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
684+ glib.SaveHandlerMapping(handlerID, cbPtr)
685+ return handlerID
684 }686 }
685 687
686 fcb := func(clsPtr uintptr) {688 fcb := func(clsPtr uintptr) {
@@ -693,7 +695,9 @@ func (x *BottomSheet) ConnectCloseAttempt(cb *func(BottomSheet)) uint32 {
693 }695 }
694 cbRefPtr := purego.NewCallback(fcb)696 cbRefPtr := purego.NewCallback(fcb)
695 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)697 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
696- return gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)698+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
699+ glib.SaveHandlerMapping(handlerID, cbPtr)
700+ return handlerID
697 }701 }
698 702
699 // Gets the progress @self will snap back to after the gesture is canceled.703 // Gets the progress @self will snap back to after the gesture is canceled.
M v4/adw/adw-breakpoint.go +14 -6
@@ -459,10 +459,12 @@ func (x *Breakpoint) GetPropertyCondition() uintptr {
459 // Emitted when the breakpoint is applied.459 // Emitted when the breakpoint is applied.
460 //460 //
461 // This signal is emitted after the setters have been applied.461 // This signal is emitted after the setters have been applied.
462-func (x *Breakpoint) ConnectApply(cb *func(Breakpoint)) uint32 {462+func (x *Breakpoint) ConnectApply(cb *func(Breakpoint)) uint {
463 cbPtr := uintptr(unsafe.Pointer(cb))463 cbPtr := uintptr(unsafe.Pointer(cb))
464 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {464 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
465- return gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)465+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
466+ glib.SaveHandlerMapping(handlerID, cbPtr)
467+ return handlerID
466 }468 }
467 469
468 fcb := func(clsPtr uintptr) {470 fcb := func(clsPtr uintptr) {
@@ -475,16 +477,20 @@ func (x *Breakpoint) ConnectApply(cb *func(Breakpoint)) uint32 {
475 }477 }
476 cbRefPtr := purego.NewCallback(fcb)478 cbRefPtr := purego.NewCallback(fcb)
477 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)479 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
478- return gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)480+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
481+ glib.SaveHandlerMapping(handlerID, cbPtr)
482+ return handlerID
479 }483 }
480 484
481 // Emitted when the breakpoint is unapplied.485 // Emitted when the breakpoint is unapplied.
482 //486 //
483 // This signal is emitted before resetting the setter values.487 // This signal is emitted before resetting the setter values.
484-func (x *Breakpoint) ConnectUnapply(cb *func(Breakpoint)) uint32 {488+func (x *Breakpoint) ConnectUnapply(cb *func(Breakpoint)) uint {
485 cbPtr := uintptr(unsafe.Pointer(cb))489 cbPtr := uintptr(unsafe.Pointer(cb))
486 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {490 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
487- return gobject.SignalConnect(x.GoPointer(), "unapply", cbRefPtr)491+ handlerID := gobject.SignalConnect(x.GoPointer(), "unapply", cbRefPtr)
492+ glib.SaveHandlerMapping(handlerID, cbPtr)
493+ return handlerID
488 }494 }
489 495
490 fcb := func(clsPtr uintptr) {496 fcb := func(clsPtr uintptr) {
@@ -497,7 +503,9 @@ func (x *Breakpoint) ConnectUnapply(cb *func(Breakpoint)) uint32 {
497 }503 }
498 cbRefPtr := purego.NewCallback(fcb)504 cbRefPtr := purego.NewCallback(fcb)
499 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)505 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
500- return gobject.SignalConnect(x.GoPointer(), "unapply", cbRefPtr)506+ handlerID := gobject.SignalConnect(x.GoPointer(), "unapply", cbRefPtr)
507+ glib.SaveHandlerMapping(handlerID, cbPtr)
508+ return handlerID
501 }509 }
502 510
503 // Gets the ID of the @buildable object.511 // Gets the ID of the @buildable object.
M v4/adw/adw-button-row.go +7 -3
@@ -199,10 +199,12 @@ func (x *ButtonRow) GetPropertyStartIconName() string {
199 }199 }
200 200
201 // This signal is emitted after the row has been activated.201 // This signal is emitted after the row has been activated.
202-func (x *ButtonRow) ConnectActivated(cb *func(ButtonRow)) uint32 {202+func (x *ButtonRow) ConnectActivated(cb *func(ButtonRow)) uint {
203 cbPtr := uintptr(unsafe.Pointer(cb))203 cbPtr := uintptr(unsafe.Pointer(cb))
204 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {204 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
205- return gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)205+ handlerID := gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)
206+ glib.SaveHandlerMapping(handlerID, cbPtr)
207+ return handlerID
206 }208 }
207 209
208 fcb := func(clsPtr uintptr) {210 fcb := func(clsPtr uintptr) {
@@ -215,7 +217,9 @@ func (x *ButtonRow) ConnectActivated(cb *func(ButtonRow)) uint32 {
215 }217 }
216 cbRefPtr := purego.NewCallback(fcb)218 cbRefPtr := purego.NewCallback(fcb)
217 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)219 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
218- return gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)220+ handlerID := gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr)
221+ glib.SaveHandlerMapping(handlerID, cbPtr)
222+ return handlerID
219 }223 }
220 224
221 // Requests the user's screen reader to announce the given message.225 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-carousel.go +7 -3
@@ -517,10 +517,12 @@ func (x *Carousel) GetPropertySpacing() uint {
517 // ::: note517 // ::: note
518 //518 //
519 // An empty carousel is indicated by `(int)index == -1`.519 // An empty carousel is indicated by `(int)index == -1`.
520-func (x *Carousel) ConnectPageChanged(cb *func(Carousel, uint)) uint32 {520+func (x *Carousel) ConnectPageChanged(cb *func(Carousel, uint)) uint {
521 cbPtr := uintptr(unsafe.Pointer(cb))521 cbPtr := uintptr(unsafe.Pointer(cb))
522 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {522 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
523- return gobject.SignalConnect(x.GoPointer(), "page-changed", cbRefPtr)523+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-changed", cbRefPtr)
524+ glib.SaveHandlerMapping(handlerID, cbPtr)
525+ return handlerID
524 }526 }
525 527
526 fcb := func(clsPtr uintptr, IndexVarp uint) {528 fcb := func(clsPtr uintptr, IndexVarp uint) {
@@ -533,7 +535,9 @@ func (x *Carousel) ConnectPageChanged(cb *func(Carousel, uint)) uint32 {
533 }535 }
534 cbRefPtr := purego.NewCallback(fcb)536 cbRefPtr := purego.NewCallback(fcb)
535 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)537 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
536- return gobject.SignalConnect(x.GoPointer(), "page-changed", cbRefPtr)538+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-changed", cbRefPtr)
539+ glib.SaveHandlerMapping(handlerID, cbPtr)
540+ return handlerID
537 }541 }
538 542
539 // Gets the progress @self will snap back to after the gesture is canceled.543 // Gets the progress @self will snap back to after the gesture is canceled.
M v4/adw/adw-dialog.go +14 -6
@@ -627,10 +627,12 @@ func (x *Dialog) GetPropertyTitle() string {
627 // Emitted when the close button or shortcut is used, or627 // Emitted when the close button or shortcut is used, or
628 // [method@Dialog.close] is called while [property@Dialog:can-close] is set to628 // [method@Dialog.close] is called while [property@Dialog:can-close] is set to
629 // `FALSE`.629 // `FALSE`.
630-func (x *Dialog) ConnectCloseAttempt(cb *func(Dialog)) uint32 {630+func (x *Dialog) ConnectCloseAttempt(cb *func(Dialog)) uint {
631 cbPtr := uintptr(unsafe.Pointer(cb))631 cbPtr := uintptr(unsafe.Pointer(cb))
632 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {632 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
633- return gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)633+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
634+ glib.SaveHandlerMapping(handlerID, cbPtr)
635+ return handlerID
634 }636 }
635 637
636 fcb := func(clsPtr uintptr) {638 fcb := func(clsPtr uintptr) {
@@ -643,14 +645,18 @@ func (x *Dialog) ConnectCloseAttempt(cb *func(Dialog)) uint32 {
643 }645 }
644 cbRefPtr := purego.NewCallback(fcb)646 cbRefPtr := purego.NewCallback(fcb)
645 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)647 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
646- return gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)648+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-attempt", cbRefPtr)
649+ glib.SaveHandlerMapping(handlerID, cbPtr)
650+ return handlerID
647 }651 }
648 652
649 // Emitted when the dialog is successfully closed.653 // Emitted when the dialog is successfully closed.
650-func (x *Dialog) ConnectClosed(cb *func(Dialog)) uint32 {654+func (x *Dialog) ConnectClosed(cb *func(Dialog)) uint {
651 cbPtr := uintptr(unsafe.Pointer(cb))655 cbPtr := uintptr(unsafe.Pointer(cb))
652 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {656 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
653- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)657+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
658+ glib.SaveHandlerMapping(handlerID, cbPtr)
659+ return handlerID
654 }660 }
655 661
656 fcb := func(clsPtr uintptr) {662 fcb := func(clsPtr uintptr) {
@@ -663,7 +669,9 @@ func (x *Dialog) ConnectClosed(cb *func(Dialog)) uint32 {
663 }669 }
664 cbRefPtr := purego.NewCallback(fcb)670 cbRefPtr := purego.NewCallback(fcb)
665 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)671 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
666- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)672+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
673+ glib.SaveHandlerMapping(handlerID, cbPtr)
674+ return handlerID
667 }675 }
668 676
669 // Requests the user's screen reader to announce the given message.677 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-entry-row.go +14 -6
@@ -428,10 +428,12 @@ func (x *EntryRow) GetPropertyTextLength() uint {
428 // Emitted when the apply button is pressed.428 // Emitted when the apply button is pressed.
429 //429 //
430 // See [property@EntryRow:show-apply-button].430 // See [property@EntryRow:show-apply-button].
431-func (x *EntryRow) ConnectApply(cb *func(EntryRow)) uint32 {431+func (x *EntryRow) ConnectApply(cb *func(EntryRow)) uint {
432 cbPtr := uintptr(unsafe.Pointer(cb))432 cbPtr := uintptr(unsafe.Pointer(cb))
433 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {433 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
434- return gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)434+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
435+ glib.SaveHandlerMapping(handlerID, cbPtr)
436+ return handlerID
435 }437 }
436 438
437 fcb := func(clsPtr uintptr) {439 fcb := func(clsPtr uintptr) {
@@ -444,14 +446,18 @@ func (x *EntryRow) ConnectApply(cb *func(EntryRow)) uint32 {
444 }446 }
445 cbRefPtr := purego.NewCallback(fcb)447 cbRefPtr := purego.NewCallback(fcb)
446 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)448 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
447- return gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)449+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
450+ glib.SaveHandlerMapping(handlerID, cbPtr)
451+ return handlerID
448 }452 }
449 453
450 // Emitted when the embedded entry is activated.454 // Emitted when the embedded entry is activated.
451-func (x *EntryRow) ConnectEntryActivated(cb *func(EntryRow)) uint32 {455+func (x *EntryRow) ConnectEntryActivated(cb *func(EntryRow)) uint {
452 cbPtr := uintptr(unsafe.Pointer(cb))456 cbPtr := uintptr(unsafe.Pointer(cb))
453 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {457 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
454- return gobject.SignalConnect(x.GoPointer(), "entry-activated", cbRefPtr)458+ handlerID := gobject.SignalConnect(x.GoPointer(), "entry-activated", cbRefPtr)
459+ glib.SaveHandlerMapping(handlerID, cbPtr)
460+ return handlerID
455 }461 }
456 462
457 fcb := func(clsPtr uintptr) {463 fcb := func(clsPtr uintptr) {
@@ -464,7 +470,9 @@ func (x *EntryRow) ConnectEntryActivated(cb *func(EntryRow)) uint32 {
464 }470 }
465 cbRefPtr := purego.NewCallback(fcb)471 cbRefPtr := purego.NewCallback(fcb)
466 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)472 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
467- return gobject.SignalConnect(x.GoPointer(), "entry-activated", cbRefPtr)473+ handlerID := gobject.SignalConnect(x.GoPointer(), "entry-activated", cbRefPtr)
474+ glib.SaveHandlerMapping(handlerID, cbPtr)
475+ return handlerID
468 }476 }
469 477
470 // Requests the user's screen reader to announce the given message.478 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-message-dialog.go +14 -6
@@ -840,10 +840,12 @@ func (x *MessageDialog) GetPropertyHeadingUseMarkup() bool {
840 // if the dialog was closed by pressing &lt;kbd&gt;Escape&lt;/kbd&gt; or with a system840 // if the dialog was closed by pressing &lt;kbd&gt;Escape&lt;/kbd&gt; or with a system
841 // action, @response will be set to the value of841 // action, @response will be set to the value of
842 // [property@MessageDialog:close-response].842 // [property@MessageDialog:close-response].
843-func (x *MessageDialog) ConnectResponse(cb *func(MessageDialog, string)) uint32 {843+func (x *MessageDialog) ConnectResponse(cb *func(MessageDialog, string)) uint {
844 cbPtr := uintptr(unsafe.Pointer(cb))844 cbPtr := uintptr(unsafe.Pointer(cb))
845 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {845 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
846- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)846+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
847+ glib.SaveHandlerMapping(handlerID, cbPtr)
848+ return handlerID
847 }849 }
848 850
849 fcb := func(clsPtr uintptr, ResponseVarp string) {851 fcb := func(clsPtr uintptr, ResponseVarp string) {
@@ -856,16 +858,20 @@ func (x *MessageDialog) ConnectResponse(cb *func(MessageDialog, string)) uint32
856 }858 }
857 cbRefPtr := purego.NewCallback(fcb)859 cbRefPtr := purego.NewCallback(fcb)
858 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)860 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
859- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)861+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
862+ glib.SaveHandlerMapping(handlerID, cbPtr)
863+ return handlerID
860 }864 }
861 865
862 // ConnectResponseWithDetail connects to the "response" signal with a detail string.866 // ConnectResponseWithDetail connects to the "response" signal with a detail string.
863 // The detail is appended as "response::<detail>".867 // The detail is appended as "response::<detail>".
864-func (x *MessageDialog) ConnectResponseWithDetail(detail string, cb *func(MessageDialog, string)) uint32 {868+func (x *MessageDialog) ConnectResponseWithDetail(detail string, cb *func(MessageDialog, string)) uint {
865 cbPtr := uintptr(unsafe.Pointer(cb))869 cbPtr := uintptr(unsafe.Pointer(cb))
866 signalName := fmt.Sprintf("response::%s", detail)870 signalName := fmt.Sprintf("response::%s", detail)
867 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {871 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
868- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)872+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
873+ glib.SaveHandlerMapping(handlerID, cbPtr)
874+ return handlerID
869 }875 }
870 876
871 fcb := func(clsPtr uintptr, ResponseVarp string) {877 fcb := func(clsPtr uintptr, ResponseVarp string) {
@@ -878,7 +884,9 @@ func (x *MessageDialog) ConnectResponseWithDetail(detail string, cb *func(Messag
878 }884 }
879 cbRefPtr := purego.NewCallback(fcb)885 cbRefPtr := purego.NewCallback(fcb)
880 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)886 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
881- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)887+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
888+ glib.SaveHandlerMapping(handlerID, cbPtr)
889+ return handlerID
882 }890 }
883 891
884 // Requests the user's screen reader to announce the given message.892 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-navigation-view.go +56 -24
@@ -431,10 +431,12 @@ func (x *NavigationPage) GetPropertyTitle() string {
431 //431 //
432 // It will always be preceded by [signal@NavigationPage::hiding] or432 // It will always be preceded by [signal@NavigationPage::hiding] or
433 // [signal@NavigationPage::showing].433 // [signal@NavigationPage::showing].
434-func (x *NavigationPage) ConnectHidden(cb *func(NavigationPage)) uint32 {434+func (x *NavigationPage) ConnectHidden(cb *func(NavigationPage)) uint {
435 cbPtr := uintptr(unsafe.Pointer(cb))435 cbPtr := uintptr(unsafe.Pointer(cb))
436 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {436 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
437- return gobject.SignalConnect(x.GoPointer(), "hidden", cbRefPtr)437+ handlerID := gobject.SignalConnect(x.GoPointer(), "hidden", cbRefPtr)
438+ glib.SaveHandlerMapping(handlerID, cbPtr)
439+ return handlerID
438 }440 }
439 441
440 fcb := func(clsPtr uintptr) {442 fcb := func(clsPtr uintptr) {
@@ -447,7 +449,9 @@ func (x *NavigationPage) ConnectHidden(cb *func(NavigationPage)) uint32 {
447 }449 }
448 cbRefPtr := purego.NewCallback(fcb)450 cbRefPtr := purego.NewCallback(fcb)
449 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)451 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
450- return gobject.SignalConnect(x.GoPointer(), "hidden", cbRefPtr)452+ handlerID := gobject.SignalConnect(x.GoPointer(), "hidden", cbRefPtr)
453+ glib.SaveHandlerMapping(handlerID, cbPtr)
454+ return handlerID
451 }455 }
452 456
453 // Emitted when the page starts hiding at the beginning of the navigation view457 // Emitted when the page starts hiding at the beginning of the navigation view
@@ -455,10 +459,12 @@ func (x *NavigationPage) ConnectHidden(cb *func(NavigationPage)) uint32 {
455 //459 //
456 // It will always be followed by [signal@NavigationPage::hidden] or460 // It will always be followed by [signal@NavigationPage::hidden] or
457 // [signal@NavigationPage::shown].461 // [signal@NavigationPage::shown].
458-func (x *NavigationPage) ConnectHiding(cb *func(NavigationPage)) uint32 {462+func (x *NavigationPage) ConnectHiding(cb *func(NavigationPage)) uint {
459 cbPtr := uintptr(unsafe.Pointer(cb))463 cbPtr := uintptr(unsafe.Pointer(cb))
460 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {464 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
461- return gobject.SignalConnect(x.GoPointer(), "hiding", cbRefPtr)465+ handlerID := gobject.SignalConnect(x.GoPointer(), "hiding", cbRefPtr)
466+ glib.SaveHandlerMapping(handlerID, cbPtr)
467+ return handlerID
462 }468 }
463 469
464 fcb := func(clsPtr uintptr) {470 fcb := func(clsPtr uintptr) {
@@ -471,7 +477,9 @@ func (x *NavigationPage) ConnectHiding(cb *func(NavigationPage)) uint32 {
471 }477 }
472 cbRefPtr := purego.NewCallback(fcb)478 cbRefPtr := purego.NewCallback(fcb)
473 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)479 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
474- return gobject.SignalConnect(x.GoPointer(), "hiding", cbRefPtr)480+ handlerID := gobject.SignalConnect(x.GoPointer(), "hiding", cbRefPtr)
481+ glib.SaveHandlerMapping(handlerID, cbPtr)
482+ return handlerID
475 }483 }
476 484
477 // Emitted when the page shows at the beginning of the navigation view485 // Emitted when the page shows at the beginning of the navigation view
@@ -479,10 +487,12 @@ func (x *NavigationPage) ConnectHiding(cb *func(NavigationPage)) uint32 {
479 //487 //
480 // It will always be followed by [signal@NavigationPage::shown] or488 // It will always be followed by [signal@NavigationPage::shown] or
481 // [signal@NavigationPage::hidden].489 // [signal@NavigationPage::hidden].
482-func (x *NavigationPage) ConnectShowing(cb *func(NavigationPage)) uint32 {490+func (x *NavigationPage) ConnectShowing(cb *func(NavigationPage)) uint {
483 cbPtr := uintptr(unsafe.Pointer(cb))491 cbPtr := uintptr(unsafe.Pointer(cb))
484 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {492 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
485- return gobject.SignalConnect(x.GoPointer(), "showing", cbRefPtr)493+ handlerID := gobject.SignalConnect(x.GoPointer(), "showing", cbRefPtr)
494+ glib.SaveHandlerMapping(handlerID, cbPtr)
495+ return handlerID
486 }496 }
487 497
488 fcb := func(clsPtr uintptr) {498 fcb := func(clsPtr uintptr) {
@@ -495,7 +505,9 @@ func (x *NavigationPage) ConnectShowing(cb *func(NavigationPage)) uint32 {
495 }505 }
496 cbRefPtr := purego.NewCallback(fcb)506 cbRefPtr := purego.NewCallback(fcb)
497 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)507 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
498- return gobject.SignalConnect(x.GoPointer(), "showing", cbRefPtr)508+ handlerID := gobject.SignalConnect(x.GoPointer(), "showing", cbRefPtr)
509+ glib.SaveHandlerMapping(handlerID, cbPtr)
510+ return handlerID
499 }511 }
500 512
501 // Emitted when the navigation view transition has been completed and the page513 // Emitted when the navigation view transition has been completed and the page
@@ -503,10 +515,12 @@ func (x *NavigationPage) ConnectShowing(cb *func(NavigationPage)) uint32 {
503 //515 //
504 // It will always be preceded by [signal@NavigationPage::showing] or516 // It will always be preceded by [signal@NavigationPage::showing] or
505 // [signal@NavigationPage::hiding].517 // [signal@NavigationPage::hiding].
506-func (x *NavigationPage) ConnectShown(cb *func(NavigationPage)) uint32 {518+func (x *NavigationPage) ConnectShown(cb *func(NavigationPage)) uint {
507 cbPtr := uintptr(unsafe.Pointer(cb))519 cbPtr := uintptr(unsafe.Pointer(cb))
508 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {520 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
509- return gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr)521+ handlerID := gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr)
522+ glib.SaveHandlerMapping(handlerID, cbPtr)
523+ return handlerID
510 }524 }
511 525
512 fcb := func(clsPtr uintptr) {526 fcb := func(clsPtr uintptr) {
@@ -519,7 +533,9 @@ func (x *NavigationPage) ConnectShown(cb *func(NavigationPage)) uint32 {
519 }533 }
520 cbRefPtr := purego.NewCallback(fcb)534 cbRefPtr := purego.NewCallback(fcb)
521 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)535 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
522- return gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr)536+ handlerID := gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr)
537+ glib.SaveHandlerMapping(handlerID, cbPtr)
538+ return handlerID
523 }539 }
524 540
525 // Requests the user's screen reader to announce the given message.541 // Requests the user's screen reader to announce the given message.
@@ -1480,10 +1496,12 @@ func (x *NavigationView) GetPropertyVisiblePageTag() string {
1480 // from a forward stack.1496 // from a forward stack.
1481 //1497 //
1482 // Instead, it should be done in the [signal@NavigationView::pushed] handler.1498 // Instead, it should be done in the [signal@NavigationView::pushed] handler.
1483-func (x *NavigationView) ConnectGetNextPage(cb *func(NavigationView) NavigationPage) uint32 {1499+func (x *NavigationView) ConnectGetNextPage(cb *func(NavigationView) NavigationPage) uint {
1484 cbPtr := uintptr(unsafe.Pointer(cb))1500 cbPtr := uintptr(unsafe.Pointer(cb))
1485 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1501 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1486- return gobject.SignalConnect(x.GoPointer(), "get-next-page", cbRefPtr)1502+ handlerID := gobject.SignalConnect(x.GoPointer(), "get-next-page", cbRefPtr)
1503+ glib.SaveHandlerMapping(handlerID, cbPtr)
1504+ return handlerID
1487 }1505 }
1488 1506
1489 fcb := func(clsPtr uintptr) uintptr {1507 fcb := func(clsPtr uintptr) uintptr {
@@ -1497,7 +1515,9 @@ func (x *NavigationView) ConnectGetNextPage(cb *func(NavigationView) NavigationP
1497 }1515 }
1498 cbRefPtr := purego.NewCallback(fcb)1516 cbRefPtr := purego.NewCallback(fcb)
1499 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1517 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1500- return gobject.SignalConnect(x.GoPointer(), "get-next-page", cbRefPtr)1518+ handlerID := gobject.SignalConnect(x.GoPointer(), "get-next-page", cbRefPtr)
1519+ glib.SaveHandlerMapping(handlerID, cbPtr)
1520+ return handlerID
1501 }1521 }
1502 1522
1503 // Emitted after @page has been popped from the navigation stack.1523 // Emitted after @page has been popped from the navigation stack.
@@ -1507,10 +1527,12 @@ func (x *NavigationView) ConnectGetNextPage(cb *func(NavigationView) NavigationP
1507 // When using [method@NavigationView.pop_to_page] or1527 // When using [method@NavigationView.pop_to_page] or
1508 // [method@NavigationView.pop_to_tag], this signal is emitted for each of the1528 // [method@NavigationView.pop_to_tag], this signal is emitted for each of the
1509 // popped pages.1529 // popped pages.
1510-func (x *NavigationView) ConnectPopped(cb *func(NavigationView, uintptr)) uint32 {1530+func (x *NavigationView) ConnectPopped(cb *func(NavigationView, uintptr)) uint {
1511 cbPtr := uintptr(unsafe.Pointer(cb))1531 cbPtr := uintptr(unsafe.Pointer(cb))
1512 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1532 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1513- return gobject.SignalConnect(x.GoPointer(), "popped", cbRefPtr)1533+ handlerID := gobject.SignalConnect(x.GoPointer(), "popped", cbRefPtr)
1534+ glib.SaveHandlerMapping(handlerID, cbPtr)
1535+ return handlerID
1514 }1536 }
1515 1537
1516 fcb := func(clsPtr uintptr, PageVarp uintptr) {1538 fcb := func(clsPtr uintptr, PageVarp uintptr) {
@@ -1523,16 +1545,20 @@ func (x *NavigationView) ConnectPopped(cb *func(NavigationView, uintptr)) uint32
1523 }1545 }
1524 cbRefPtr := purego.NewCallback(fcb)1546 cbRefPtr := purego.NewCallback(fcb)
1525 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1547 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1526- return gobject.SignalConnect(x.GoPointer(), "popped", cbRefPtr)1548+ handlerID := gobject.SignalConnect(x.GoPointer(), "popped", cbRefPtr)
1549+ glib.SaveHandlerMapping(handlerID, cbPtr)
1550+ return handlerID
1527 }1551 }
1528 1552
1529 // Emitted after a page has been pushed to the navigation stack.1553 // Emitted after a page has been pushed to the navigation stack.
1530 //1554 //
1531 // See [method@NavigationView.push].1555 // See [method@NavigationView.push].
1532-func (x *NavigationView) ConnectPushed(cb *func(NavigationView)) uint32 {1556+func (x *NavigationView) ConnectPushed(cb *func(NavigationView)) uint {
1533 cbPtr := uintptr(unsafe.Pointer(cb))1557 cbPtr := uintptr(unsafe.Pointer(cb))
1534 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1558 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1535- return gobject.SignalConnect(x.GoPointer(), "pushed", cbRefPtr)1559+ handlerID := gobject.SignalConnect(x.GoPointer(), "pushed", cbRefPtr)
1560+ glib.SaveHandlerMapping(handlerID, cbPtr)
1561+ return handlerID
1536 }1562 }
1537 1563
1538 fcb := func(clsPtr uintptr) {1564 fcb := func(clsPtr uintptr) {
@@ -1545,16 +1571,20 @@ func (x *NavigationView) ConnectPushed(cb *func(NavigationView)) uint32 {
1545 }1571 }
1546 cbRefPtr := purego.NewCallback(fcb)1572 cbRefPtr := purego.NewCallback(fcb)
1547 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1573 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1548- return gobject.SignalConnect(x.GoPointer(), "pushed", cbRefPtr)1574+ handlerID := gobject.SignalConnect(x.GoPointer(), "pushed", cbRefPtr)
1575+ glib.SaveHandlerMapping(handlerID, cbPtr)
1576+ return handlerID
1549 }1577 }
1550 1578
1551 // Emitted after the navigation stack has been replaced.1579 // Emitted after the navigation stack has been replaced.
1552 //1580 //
1553 // See [method@NavigationView.replace].1581 // See [method@NavigationView.replace].
1554-func (x *NavigationView) ConnectReplaced(cb *func(NavigationView)) uint32 {1582+func (x *NavigationView) ConnectReplaced(cb *func(NavigationView)) uint {
1555 cbPtr := uintptr(unsafe.Pointer(cb))1583 cbPtr := uintptr(unsafe.Pointer(cb))
1556 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1584 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1557- return gobject.SignalConnect(x.GoPointer(), "replaced", cbRefPtr)1585+ handlerID := gobject.SignalConnect(x.GoPointer(), "replaced", cbRefPtr)
1586+ glib.SaveHandlerMapping(handlerID, cbPtr)
1587+ return handlerID
1558 }1588 }
1559 1589
1560 fcb := func(clsPtr uintptr) {1590 fcb := func(clsPtr uintptr) {
@@ -1567,7 +1597,9 @@ func (x *NavigationView) ConnectReplaced(cb *func(NavigationView)) uint32 {
1567 }1597 }
1568 cbRefPtr := purego.NewCallback(fcb)1598 cbRefPtr := purego.NewCallback(fcb)
1569 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1599 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1570- return gobject.SignalConnect(x.GoPointer(), "replaced", cbRefPtr)1600+ handlerID := gobject.SignalConnect(x.GoPointer(), "replaced", cbRefPtr)
1601+ glib.SaveHandlerMapping(handlerID, cbPtr)
1602+ return handlerID
1571 }1603 }
1572 1604
1573 // Gets the progress @self will snap back to after the gesture is canceled.1605 // Gets the progress @self will snap back to after the gesture is canceled.
M v4/adw/adw-spin-row.go +21 -9
@@ -439,10 +439,12 @@ func (x *SpinRow) GetPropertyWrap() bool {
439 // The default conversion uses [func@GLib.strtod].439 // The default conversion uses [func@GLib.strtod].
440 //440 //
441 // See [signal@Gtk.SpinButton::input].441 // See [signal@Gtk.SpinButton::input].
442-func (x *SpinRow) ConnectInput(cb *func(SpinRow, *float64) int) uint32 {442+func (x *SpinRow) ConnectInput(cb *func(SpinRow, *float64) int) uint {
443 cbPtr := uintptr(unsafe.Pointer(cb))443 cbPtr := uintptr(unsafe.Pointer(cb))
444 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {444 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
445- return gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)445+ handlerID := gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)
446+ glib.SaveHandlerMapping(handlerID, cbPtr)
447+ return handlerID
446 }448 }
447 449
448 fcb := func(clsPtr uintptr, NewValueVarp *float64) int {450 fcb := func(clsPtr uintptr, NewValueVarp *float64) int {
@@ -455,16 +457,20 @@ func (x *SpinRow) ConnectInput(cb *func(SpinRow, *float64) int) uint32 {
455 }457 }
456 cbRefPtr := purego.NewCallback(fcb)458 cbRefPtr := purego.NewCallback(fcb)
457 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)459 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
458- return gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)460+ handlerID := gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)
461+ glib.SaveHandlerMapping(handlerID, cbPtr)
462+ return handlerID
459 }463 }
460 464
461 // Emitted to tweak the formatting of the value for display.465 // Emitted to tweak the formatting of the value for display.
462 //466 //
463 // See [signal@Gtk.SpinButton::output].467 // See [signal@Gtk.SpinButton::output].
464-func (x *SpinRow) ConnectOutput(cb *func(SpinRow) bool) uint32 {468+func (x *SpinRow) ConnectOutput(cb *func(SpinRow) bool) uint {
465 cbPtr := uintptr(unsafe.Pointer(cb))469 cbPtr := uintptr(unsafe.Pointer(cb))
466 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {470 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
467- return gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)471+ handlerID := gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)
472+ glib.SaveHandlerMapping(handlerID, cbPtr)
473+ return handlerID
468 }474 }
469 475
470 fcb := func(clsPtr uintptr) bool {476 fcb := func(clsPtr uintptr) bool {
@@ -477,16 +483,20 @@ func (x *SpinRow) ConnectOutput(cb *func(SpinRow) bool) uint32 {
477 }483 }
478 cbRefPtr := purego.NewCallback(fcb)484 cbRefPtr := purego.NewCallback(fcb)
479 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)485 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
480- return gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)486+ handlerID := gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)
487+ glib.SaveHandlerMapping(handlerID, cbPtr)
488+ return handlerID
481 }489 }
482 490
483 // Emitted right after the spinbutton wraps.491 // Emitted right after the spinbutton wraps.
484 //492 //
485 // See [signal@Gtk.SpinButton::wrapped].493 // See [signal@Gtk.SpinButton::wrapped].
486-func (x *SpinRow) ConnectWrapped(cb *func(SpinRow)) uint32 {494+func (x *SpinRow) ConnectWrapped(cb *func(SpinRow)) uint {
487 cbPtr := uintptr(unsafe.Pointer(cb))495 cbPtr := uintptr(unsafe.Pointer(cb))
488 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {496 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
489- return gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)497+ handlerID := gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)
498+ glib.SaveHandlerMapping(handlerID, cbPtr)
499+ return handlerID
490 }500 }
491 501
492 fcb := func(clsPtr uintptr) {502 fcb := func(clsPtr uintptr) {
@@ -499,7 +509,9 @@ func (x *SpinRow) ConnectWrapped(cb *func(SpinRow)) uint32 {
499 }509 }
500 cbRefPtr := purego.NewCallback(fcb)510 cbRefPtr := purego.NewCallback(fcb)
501 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)511 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
502- return gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)512+ handlerID := gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)
513+ glib.SaveHandlerMapping(handlerID, cbPtr)
514+ return handlerID
503 }515 }
504 516
505 // Requests the user's screen reader to announce the given message.517 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-split-button.go +14 -6
@@ -488,10 +488,12 @@ func (x *SplitButton) GetPropertyUseUnderline() bool {
488 //488 //
489 // This is an action signal. Applications should never connect to this signal,489 // This is an action signal. Applications should never connect to this signal,
490 // but use the [signal@SplitButton::clicked] signal.490 // but use the [signal@SplitButton::clicked] signal.
491-func (x *SplitButton) ConnectActivate(cb *func(SplitButton)) uint32 {491+func (x *SplitButton) ConnectActivate(cb *func(SplitButton)) uint {
492 cbPtr := uintptr(unsafe.Pointer(cb))492 cbPtr := uintptr(unsafe.Pointer(cb))
493 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {493 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
494- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)494+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
495+ glib.SaveHandlerMapping(handlerID, cbPtr)
496+ return handlerID
495 }497 }
496 498
497 fcb := func(clsPtr uintptr) {499 fcb := func(clsPtr uintptr) {
@@ -504,14 +506,18 @@ func (x *SplitButton) ConnectActivate(cb *func(SplitButton)) uint32 {
504 }506 }
505 cbRefPtr := purego.NewCallback(fcb)507 cbRefPtr := purego.NewCallback(fcb)
506 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)508 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
507- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)509+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
510+ glib.SaveHandlerMapping(handlerID, cbPtr)
511+ return handlerID
508 }512 }
509 513
510 // Emitted when the button has been activated (pressed and released).514 // Emitted when the button has been activated (pressed and released).
511-func (x *SplitButton) ConnectClicked(cb *func(SplitButton)) uint32 {515+func (x *SplitButton) ConnectClicked(cb *func(SplitButton)) uint {
512 cbPtr := uintptr(unsafe.Pointer(cb))516 cbPtr := uintptr(unsafe.Pointer(cb))
513 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {517 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
514- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)518+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
519+ glib.SaveHandlerMapping(handlerID, cbPtr)
520+ return handlerID
515 }521 }
516 522
517 fcb := func(clsPtr uintptr) {523 fcb := func(clsPtr uintptr) {
@@ -524,7 +530,9 @@ func (x *SplitButton) ConnectClicked(cb *func(SplitButton)) uint32 {
524 }530 }
525 cbRefPtr := purego.NewCallback(fcb)531 cbRefPtr := purego.NewCallback(fcb)
526 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)532 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
527- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)533+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
534+ glib.SaveHandlerMapping(handlerID, cbPtr)
535+ return handlerID
528 }536 }
529 537
530 // Requests the user's screen reader to announce the given message.538 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-swipe-tracker.go +28 -12
@@ -393,10 +393,12 @@ func (x *SwipeTracker) GetPropertyUpperOvershoot() bool {
393 393
394 // This signal is emitted right before a swipe will be started, after the394 // This signal is emitted right before a swipe will be started, after the
395 // drag threshold has been passed.395 // drag threshold has been passed.
396-func (x *SwipeTracker) ConnectBeginSwipe(cb *func(SwipeTracker)) uint32 {396+func (x *SwipeTracker) ConnectBeginSwipe(cb *func(SwipeTracker)) uint {
397 cbPtr := uintptr(unsafe.Pointer(cb))397 cbPtr := uintptr(unsafe.Pointer(cb))
398 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {398 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
399- return gobject.SignalConnect(x.GoPointer(), "begin-swipe", cbRefPtr)399+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin-swipe", cbRefPtr)
400+ glib.SaveHandlerMapping(handlerID, cbPtr)
401+ return handlerID
400 }402 }
401 403
402 fcb := func(clsPtr uintptr) {404 fcb := func(clsPtr uintptr) {
@@ -409,7 +411,9 @@ func (x *SwipeTracker) ConnectBeginSwipe(cb *func(SwipeTracker)) uint32 {
409 }411 }
410 cbRefPtr := purego.NewCallback(fcb)412 cbRefPtr := purego.NewCallback(fcb)
411 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)413 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
412- return gobject.SignalConnect(x.GoPointer(), "begin-swipe", cbRefPtr)414+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin-swipe", cbRefPtr)
415+ glib.SaveHandlerMapping(handlerID, cbPtr)
416+ return handlerID
413 }417 }
414 418
415 // This signal is emitted as soon as the gesture has stopped.419 // This signal is emitted as soon as the gesture has stopped.
@@ -418,10 +422,12 @@ func (x *SwipeTracker) ConnectBeginSwipe(cb *func(SwipeTracker)) uint32 {
418 // value to @to with an animation using @velocity as the initial velocity,422 // value to @to with an animation using @velocity as the initial velocity,
419 // provided in pixels per second. [class@SpringAnimation] is usually a good423 // provided in pixels per second. [class@SpringAnimation] is usually a good
420 // fit for this.424 // fit for this.
421-func (x *SwipeTracker) ConnectEndSwipe(cb *func(SwipeTracker, float64, float64)) uint32 {425+func (x *SwipeTracker) ConnectEndSwipe(cb *func(SwipeTracker, float64, float64)) uint {
422 cbPtr := uintptr(unsafe.Pointer(cb))426 cbPtr := uintptr(unsafe.Pointer(cb))
423 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {427 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
424- return gobject.SignalConnect(x.GoPointer(), "end-swipe", cbRefPtr)428+ handlerID := gobject.SignalConnect(x.GoPointer(), "end-swipe", cbRefPtr)
429+ glib.SaveHandlerMapping(handlerID, cbPtr)
430+ return handlerID
425 }431 }
426 432
427 fcb := func(clsPtr uintptr, VelocityVarp float64, ToVarp float64) {433 fcb := func(clsPtr uintptr, VelocityVarp float64, ToVarp float64) {
@@ -434,17 +440,21 @@ func (x *SwipeTracker) ConnectEndSwipe(cb *func(SwipeTracker, float64, float64))
434 }440 }
435 cbRefPtr := purego.NewCallback(fcb)441 cbRefPtr := purego.NewCallback(fcb)
436 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)442 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
437- return gobject.SignalConnect(x.GoPointer(), "end-swipe", cbRefPtr)443+ handlerID := gobject.SignalConnect(x.GoPointer(), "end-swipe", cbRefPtr)
444+ glib.SaveHandlerMapping(handlerID, cbPtr)
445+ return handlerID
438 }446 }
439 447
440 // This signal is emitted when a possible swipe is detected.448 // This signal is emitted when a possible swipe is detected.
441 //449 //
442 // The @direction value can be used to restrict the swipe to a certain450 // The @direction value can be used to restrict the swipe to a certain
443 // direction.451 // direction.
444-func (x *SwipeTracker) ConnectPrepare(cb *func(SwipeTracker, NavigationDirection)) uint32 {452+func (x *SwipeTracker) ConnectPrepare(cb *func(SwipeTracker, NavigationDirection)) uint {
445 cbPtr := uintptr(unsafe.Pointer(cb))453 cbPtr := uintptr(unsafe.Pointer(cb))
446 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {454 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
447- return gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)455+ handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
456+ glib.SaveHandlerMapping(handlerID, cbPtr)
457+ return handlerID
448 }458 }
449 459
450 fcb := func(clsPtr uintptr, DirectionVarp NavigationDirection) {460 fcb := func(clsPtr uintptr, DirectionVarp NavigationDirection) {
@@ -457,14 +467,18 @@ func (x *SwipeTracker) ConnectPrepare(cb *func(SwipeTracker, NavigationDirection
457 }467 }
458 cbRefPtr := purego.NewCallback(fcb)468 cbRefPtr := purego.NewCallback(fcb)
459 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)469 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
460- return gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)470+ handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
471+ glib.SaveHandlerMapping(handlerID, cbPtr)
472+ return handlerID
461 }473 }
462 474
463 // This signal is emitted every time the progress value changes.475 // This signal is emitted every time the progress value changes.
464-func (x *SwipeTracker) ConnectUpdateSwipe(cb *func(SwipeTracker, float64)) uint32 {476+func (x *SwipeTracker) ConnectUpdateSwipe(cb *func(SwipeTracker, float64)) uint {
465 cbPtr := uintptr(unsafe.Pointer(cb))477 cbPtr := uintptr(unsafe.Pointer(cb))
466 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {478 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
467- return gobject.SignalConnect(x.GoPointer(), "update-swipe", cbRefPtr)479+ handlerID := gobject.SignalConnect(x.GoPointer(), "update-swipe", cbRefPtr)
480+ glib.SaveHandlerMapping(handlerID, cbPtr)
481+ return handlerID
468 }482 }
469 483
470 fcb := func(clsPtr uintptr, ProgressVarp float64) {484 fcb := func(clsPtr uintptr, ProgressVarp float64) {
@@ -477,7 +491,9 @@ func (x *SwipeTracker) ConnectUpdateSwipe(cb *func(SwipeTracker, float64)) uint3
477 }491 }
478 cbRefPtr := purego.NewCallback(fcb)492 cbRefPtr := purego.NewCallback(fcb)
479 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)493 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
480- return gobject.SignalConnect(x.GoPointer(), "update-swipe", cbRefPtr)494+ handlerID := gobject.SignalConnect(x.GoPointer(), "update-swipe", cbRefPtr)
495+ glib.SaveHandlerMapping(handlerID, cbPtr)
496+ return handlerID
481 }497 }
482 498
483 // Retrieves the orientation of the @orientable.499 // Retrieves the orientation of the @orientable.
M v4/adw/adw-tab-bar.go +14 -6
@@ -444,10 +444,12 @@ func (x *TabBar) GetPropertyTabsRevealed() bool {
444 // [method@TabBar.setup_extra_drop_target].444 // [method@TabBar.setup_extra_drop_target].
445 //445 //
446 // See [signal@Gtk.DropTarget::drop].446 // See [signal@Gtk.DropTarget::drop].
447-func (x *TabBar) ConnectExtraDragDrop(cb *func(TabBar, uintptr, uintptr) bool) uint32 {447+func (x *TabBar) ConnectExtraDragDrop(cb *func(TabBar, uintptr, uintptr) bool) uint {
448 cbPtr := uintptr(unsafe.Pointer(cb))448 cbPtr := uintptr(unsafe.Pointer(cb))
449 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {449 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
450- return gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)450+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)
451+ glib.SaveHandlerMapping(handlerID, cbPtr)
452+ return handlerID
451 }453 }
452 454
453 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) bool {455 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) bool {
@@ -460,7 +462,9 @@ func (x *TabBar) ConnectExtraDragDrop(cb *func(TabBar, uintptr, uintptr) bool) u
460 }462 }
461 cbRefPtr := purego.NewCallback(fcb)463 cbRefPtr := purego.NewCallback(fcb)
462 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)464 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
463- return gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)465+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)
466+ glib.SaveHandlerMapping(handlerID, cbPtr)
467+ return handlerID
464 }468 }
465 469
466 // This signal is emitted when the dropped content is preloaded.470 // This signal is emitted when the dropped content is preloaded.
@@ -472,10 +476,12 @@ func (x *TabBar) ConnectExtraDragDrop(cb *func(TabBar, uintptr, uintptr) bool) u
472 // [method@TabBar.setup_extra_drop_target].476 // [method@TabBar.setup_extra_drop_target].
473 //477 //
474 // See [property@Gtk.DropTarget:value].478 // See [property@Gtk.DropTarget:value].
475-func (x *TabBar) ConnectExtraDragValue(cb *func(TabBar, uintptr, uintptr) gdk.DragAction) uint32 {479+func (x *TabBar) ConnectExtraDragValue(cb *func(TabBar, uintptr, uintptr) gdk.DragAction) uint {
476 cbPtr := uintptr(unsafe.Pointer(cb))480 cbPtr := uintptr(unsafe.Pointer(cb))
477 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {481 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
478- return gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)482+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)
483+ glib.SaveHandlerMapping(handlerID, cbPtr)
484+ return handlerID
479 }485 }
480 486
481 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) gdk.DragAction {487 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) gdk.DragAction {
@@ -488,7 +494,9 @@ func (x *TabBar) ConnectExtraDragValue(cb *func(TabBar, uintptr, uintptr) gdk.Dr
488 }494 }
489 cbRefPtr := purego.NewCallback(fcb)495 cbRefPtr := purego.NewCallback(fcb)
490 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)496 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
491- return gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)497+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)
498+ glib.SaveHandlerMapping(handlerID, cbPtr)
499+ return handlerID
492 }500 }
493 501
494 // Requests the user's screen reader to announce the given message.502 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-tab-button.go +14 -6
@@ -130,10 +130,12 @@ func (c *TabButton) SetGoPointer(ptr uintptr) {
130 //130 //
131 // This is an action signal. Applications should never connect to this signal,131 // This is an action signal. Applications should never connect to this signal,
132 // but use the [signal@TabButton::clicked] signal.132 // but use the [signal@TabButton::clicked] signal.
133-func (x *TabButton) ConnectActivate(cb *func(TabButton)) uint32 {133+func (x *TabButton) ConnectActivate(cb *func(TabButton)) uint {
134 cbPtr := uintptr(unsafe.Pointer(cb))134 cbPtr := uintptr(unsafe.Pointer(cb))
135 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {135 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
136- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)136+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
137+ glib.SaveHandlerMapping(handlerID, cbPtr)
138+ return handlerID
137 }139 }
138 140
139 fcb := func(clsPtr uintptr) {141 fcb := func(clsPtr uintptr) {
@@ -146,14 +148,18 @@ func (x *TabButton) ConnectActivate(cb *func(TabButton)) uint32 {
146 }148 }
147 cbRefPtr := purego.NewCallback(fcb)149 cbRefPtr := purego.NewCallback(fcb)
148 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)150 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
149- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)151+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
152+ glib.SaveHandlerMapping(handlerID, cbPtr)
153+ return handlerID
150 }154 }
151 155
152 // Emitted when the button has been activated (pressed and released).156 // Emitted when the button has been activated (pressed and released).
153-func (x *TabButton) ConnectClicked(cb *func(TabButton)) uint32 {157+func (x *TabButton) ConnectClicked(cb *func(TabButton)) uint {
154 cbPtr := uintptr(unsafe.Pointer(cb))158 cbPtr := uintptr(unsafe.Pointer(cb))
155 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {159 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
156- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)160+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
161+ glib.SaveHandlerMapping(handlerID, cbPtr)
162+ return handlerID
157 }163 }
158 164
159 fcb := func(clsPtr uintptr) {165 fcb := func(clsPtr uintptr) {
@@ -166,7 +172,9 @@ func (x *TabButton) ConnectClicked(cb *func(TabButton)) uint32 {
166 }172 }
167 cbRefPtr := purego.NewCallback(fcb)173 cbRefPtr := purego.NewCallback(fcb)
168 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)174 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
169- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)175+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
176+ glib.SaveHandlerMapping(handlerID, cbPtr)
177+ return handlerID
170 }178 }
171 179
172 // Requests the user's screen reader to announce the given message.180 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-tab-overview.go +21 -9
@@ -580,10 +580,12 @@ func (x *TabOverview) GetPropertyShowStartTitleButtons() bool {
580 //580 //
581 // The signal handler is expected to create a new page in the corresponding581 // The signal handler is expected to create a new page in the corresponding
582 // [class@TabView] and return it.582 // [class@TabView] and return it.
583-func (x *TabOverview) ConnectCreateTab(cb *func(TabOverview) TabPage) uint32 {583+func (x *TabOverview) ConnectCreateTab(cb *func(TabOverview) TabPage) uint {
584 cbPtr := uintptr(unsafe.Pointer(cb))584 cbPtr := uintptr(unsafe.Pointer(cb))
585 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {585 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
586- return gobject.SignalConnect(x.GoPointer(), "create-tab", cbRefPtr)586+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-tab", cbRefPtr)
587+ glib.SaveHandlerMapping(handlerID, cbPtr)
588+ return handlerID
587 }589 }
588 590
589 fcb := func(clsPtr uintptr) uintptr {591 fcb := func(clsPtr uintptr) uintptr {
@@ -597,7 +599,9 @@ func (x *TabOverview) ConnectCreateTab(cb *func(TabOverview) TabPage) uint32 {
597 }599 }
598 cbRefPtr := purego.NewCallback(fcb)600 cbRefPtr := purego.NewCallback(fcb)
599 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)601 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
600- return gobject.SignalConnect(x.GoPointer(), "create-tab", cbRefPtr)602+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-tab", cbRefPtr)
603+ glib.SaveHandlerMapping(handlerID, cbPtr)
604+ return handlerID
601 }605 }
602 606
603 // This signal is emitted when content is dropped onto a tab.607 // This signal is emitted when content is dropped onto a tab.
@@ -606,10 +610,12 @@ func (x *TabOverview) ConnectCreateTab(cb *func(TabOverview) TabPage) uint32 {
606 // [method@TabOverview.setup_extra_drop_target].610 // [method@TabOverview.setup_extra_drop_target].
607 //611 //
608 // See [signal@Gtk.DropTarget::drop].612 // See [signal@Gtk.DropTarget::drop].
609-func (x *TabOverview) ConnectExtraDragDrop(cb *func(TabOverview, uintptr, uintptr) bool) uint32 {613+func (x *TabOverview) ConnectExtraDragDrop(cb *func(TabOverview, uintptr, uintptr) bool) uint {
610 cbPtr := uintptr(unsafe.Pointer(cb))614 cbPtr := uintptr(unsafe.Pointer(cb))
611 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {615 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
612- return gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)616+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)
617+ glib.SaveHandlerMapping(handlerID, cbPtr)
618+ return handlerID
613 }619 }
614 620
615 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) bool {621 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) bool {
@@ -622,7 +628,9 @@ func (x *TabOverview) ConnectExtraDragDrop(cb *func(TabOverview, uintptr, uintpt
622 }628 }
623 cbRefPtr := purego.NewCallback(fcb)629 cbRefPtr := purego.NewCallback(fcb)
624 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)630 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
625- return gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)631+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-drop", cbRefPtr)
632+ glib.SaveHandlerMapping(handlerID, cbPtr)
633+ return handlerID
626 }634 }
627 635
628 // This signal is emitted when the dropped content is preloaded.636 // This signal is emitted when the dropped content is preloaded.
@@ -634,10 +642,12 @@ func (x *TabOverview) ConnectExtraDragDrop(cb *func(TabOverview, uintptr, uintpt
634 // [method@TabOverview.setup_extra_drop_target].642 // [method@TabOverview.setup_extra_drop_target].
635 //643 //
636 // See [property@Gtk.DropTarget:value].644 // See [property@Gtk.DropTarget:value].
637-func (x *TabOverview) ConnectExtraDragValue(cb *func(TabOverview, uintptr, uintptr) gdk.DragAction) uint32 {645+func (x *TabOverview) ConnectExtraDragValue(cb *func(TabOverview, uintptr, uintptr) gdk.DragAction) uint {
638 cbPtr := uintptr(unsafe.Pointer(cb))646 cbPtr := uintptr(unsafe.Pointer(cb))
639 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {647 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
640- return gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)648+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)
649+ glib.SaveHandlerMapping(handlerID, cbPtr)
650+ return handlerID
641 }651 }
642 652
643 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) gdk.DragAction {653 fcb := func(clsPtr uintptr, PageVarp uintptr, ValueVarp uintptr) gdk.DragAction {
@@ -650,7 +660,9 @@ func (x *TabOverview) ConnectExtraDragValue(cb *func(TabOverview, uintptr, uintp
650 }660 }
651 cbRefPtr := purego.NewCallback(fcb)661 cbRefPtr := purego.NewCallback(fcb)
652 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)662 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
653- return gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)663+ handlerID := gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr)
664+ glib.SaveHandlerMapping(handlerID, cbPtr)
665+ return handlerID
654 }666 }
655 667
656 // Requests the user's screen reader to announce the given message.668 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-tab-view.go +49 -21
@@ -1852,10 +1852,12 @@ func (x *TabView) GetPropertyNPinnedPages() int {
1852 //1852 //
1853 // The signal handler should return `GDK_EVENT_STOP` to stop propagation or1853 // The signal handler should return `GDK_EVENT_STOP` to stop propagation or
1854 // `GDK_EVENT_CONTINUE` to invoke the default handler.1854 // `GDK_EVENT_CONTINUE` to invoke the default handler.
1855-func (x *TabView) ConnectClosePage(cb *func(TabView, uintptr) bool) uint32 {1855+func (x *TabView) ConnectClosePage(cb *func(TabView, uintptr) bool) uint {
1856 cbPtr := uintptr(unsafe.Pointer(cb))1856 cbPtr := uintptr(unsafe.Pointer(cb))
1857 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1857 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1858- return gobject.SignalConnect(x.GoPointer(), "close-page", cbRefPtr)1858+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-page", cbRefPtr)
1859+ glib.SaveHandlerMapping(handlerID, cbPtr)
1860+ return handlerID
1859 }1861 }
1860 1862
1861 fcb := func(clsPtr uintptr, PageVarp uintptr) bool {1863 fcb := func(clsPtr uintptr, PageVarp uintptr) bool {
@@ -1868,7 +1870,9 @@ func (x *TabView) ConnectClosePage(cb *func(TabView, uintptr) bool) uint32 {
1868 }1870 }
1869 cbRefPtr := purego.NewCallback(fcb)1871 cbRefPtr := purego.NewCallback(fcb)
1870 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1872 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1871- return gobject.SignalConnect(x.GoPointer(), "close-page", cbRefPtr)1873+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-page", cbRefPtr)
1874+ glib.SaveHandlerMapping(handlerID, cbPtr)
1875+ return handlerID
1872 }1876 }
1873 1877
1874 // Emitted when a tab should be transferred into a new window.1878 // Emitted when a tab should be transferred into a new window.
@@ -1877,10 +1881,12 @@ func (x *TabView) ConnectClosePage(cb *func(TabView, uintptr) bool) uint32 {
1877 //1881 //
1878 // The signal handler is expected to create a new window, position it as1882 // The signal handler is expected to create a new window, position it as
1879 // needed and return its `AdwTabView` that the page will be transferred into.1883 // needed and return its `AdwTabView` that the page will be transferred into.
1880-func (x *TabView) ConnectCreateWindow(cb *func(TabView) TabView) uint32 {1884+func (x *TabView) ConnectCreateWindow(cb *func(TabView) TabView) uint {
1881 cbPtr := uintptr(unsafe.Pointer(cb))1885 cbPtr := uintptr(unsafe.Pointer(cb))
1882 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1886 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1883- return gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)1887+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)
1888+ glib.SaveHandlerMapping(handlerID, cbPtr)
1889+ return handlerID
1884 }1890 }
1885 1891
1886 fcb := func(clsPtr uintptr) uintptr {1892 fcb := func(clsPtr uintptr) uintptr {
@@ -1894,17 +1900,21 @@ func (x *TabView) ConnectCreateWindow(cb *func(TabView) TabView) uint32 {
1894 }1900 }
1895 cbRefPtr := purego.NewCallback(fcb)1901 cbRefPtr := purego.NewCallback(fcb)
1896 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1902 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1897- return gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)1903+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)
1904+ glib.SaveHandlerMapping(handlerID, cbPtr)
1905+ return handlerID
1898 }1906 }
1899 1907
1900 // Emitted after the indicator icon on @page has been activated.1908 // Emitted after the indicator icon on @page has been activated.
1901 //1909 //
1902 // See [property@TabPage:indicator-icon] and1910 // See [property@TabPage:indicator-icon] and
1903 // [property@TabPage:indicator-activatable].1911 // [property@TabPage:indicator-activatable].
1904-func (x *TabView) ConnectIndicatorActivated(cb *func(TabView, uintptr)) uint32 {1912+func (x *TabView) ConnectIndicatorActivated(cb *func(TabView, uintptr)) uint {
1905 cbPtr := uintptr(unsafe.Pointer(cb))1913 cbPtr := uintptr(unsafe.Pointer(cb))
1906 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1914 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1907- return gobject.SignalConnect(x.GoPointer(), "indicator-activated", cbRefPtr)1915+ handlerID := gobject.SignalConnect(x.GoPointer(), "indicator-activated", cbRefPtr)
1916+ glib.SaveHandlerMapping(handlerID, cbPtr)
1917+ return handlerID
1908 }1918 }
1909 1919
1910 fcb := func(clsPtr uintptr, PageVarp uintptr) {1920 fcb := func(clsPtr uintptr, PageVarp uintptr) {
@@ -1917,17 +1927,21 @@ func (x *TabView) ConnectIndicatorActivated(cb *func(TabView, uintptr)) uint32 {
1917 }1927 }
1918 cbRefPtr := purego.NewCallback(fcb)1928 cbRefPtr := purego.NewCallback(fcb)
1919 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1929 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1920- return gobject.SignalConnect(x.GoPointer(), "indicator-activated", cbRefPtr)1930+ handlerID := gobject.SignalConnect(x.GoPointer(), "indicator-activated", cbRefPtr)
1931+ glib.SaveHandlerMapping(handlerID, cbPtr)
1932+ return handlerID
1921 }1933 }
1922 1934
1923 // Emitted when a page has been created or transferred to @self.1935 // Emitted when a page has been created or transferred to @self.
1924 //1936 //
1925 // A typical reason to connect to this signal would be to connect to page1937 // A typical reason to connect to this signal would be to connect to page
1926 // signals for things such as updating window title.1938 // signals for things such as updating window title.
1927-func (x *TabView) ConnectPageAttached(cb *func(TabView, uintptr, int)) uint32 {1939+func (x *TabView) ConnectPageAttached(cb *func(TabView, uintptr, int)) uint {
1928 cbPtr := uintptr(unsafe.Pointer(cb))1940 cbPtr := uintptr(unsafe.Pointer(cb))
1929 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1941 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1930- return gobject.SignalConnect(x.GoPointer(), "page-attached", cbRefPtr)1942+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-attached", cbRefPtr)
1943+ glib.SaveHandlerMapping(handlerID, cbPtr)
1944+ return handlerID
1931 }1945 }
1932 1946
1933 fcb := func(clsPtr uintptr, PageVarp uintptr, PositionVarp int) {1947 fcb := func(clsPtr uintptr, PageVarp uintptr, PositionVarp int) {
@@ -1940,7 +1954,9 @@ func (x *TabView) ConnectPageAttached(cb *func(TabView, uintptr, int)) uint32 {
1940 }1954 }
1941 cbRefPtr := purego.NewCallback(fcb)1955 cbRefPtr := purego.NewCallback(fcb)
1942 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1956 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1943- return gobject.SignalConnect(x.GoPointer(), "page-attached", cbRefPtr)1957+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-attached", cbRefPtr)
1958+ glib.SaveHandlerMapping(handlerID, cbPtr)
1959+ return handlerID
1944 }1960 }
1945 1961
1946 // Emitted when a page has been removed or transferred to another view.1962 // Emitted when a page has been removed or transferred to another view.
@@ -1952,10 +1968,12 @@ func (x *TabView) ConnectPageAttached(cb *func(TabView, uintptr, int)) uint32 {
1952 // this function as the child might merely be moved to another window; use1968 // this function as the child might merely be moved to another window; use
1953 // child dispose handler for that or do it in sync with your1969 // child dispose handler for that or do it in sync with your
1954 // [method@TabView.close_page_finish] calls.1970 // [method@TabView.close_page_finish] calls.
1955-func (x *TabView) ConnectPageDetached(cb *func(TabView, uintptr, int)) uint32 {1971+func (x *TabView) ConnectPageDetached(cb *func(TabView, uintptr, int)) uint {
1956 cbPtr := uintptr(unsafe.Pointer(cb))1972 cbPtr := uintptr(unsafe.Pointer(cb))
1957 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1973 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1958- return gobject.SignalConnect(x.GoPointer(), "page-detached", cbRefPtr)1974+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-detached", cbRefPtr)
1975+ glib.SaveHandlerMapping(handlerID, cbPtr)
1976+ return handlerID
1959 }1977 }
1960 1978
1961 fcb := func(clsPtr uintptr, PageVarp uintptr, PositionVarp int) {1979 fcb := func(clsPtr uintptr, PageVarp uintptr, PositionVarp int) {
@@ -1968,14 +1986,18 @@ func (x *TabView) ConnectPageDetached(cb *func(TabView, uintptr, int)) uint32 {
1968 }1986 }
1969 cbRefPtr := purego.NewCallback(fcb)1987 cbRefPtr := purego.NewCallback(fcb)
1970 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1988 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1971- return gobject.SignalConnect(x.GoPointer(), "page-detached", cbRefPtr)1989+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-detached", cbRefPtr)
1990+ glib.SaveHandlerMapping(handlerID, cbPtr)
1991+ return handlerID
1972 }1992 }
1973 1993
1974 // Emitted after @page has been reordered to @position.1994 // Emitted after @page has been reordered to @position.
1975-func (x *TabView) ConnectPageReordered(cb *func(TabView, uintptr, int)) uint32 {1995+func (x *TabView) ConnectPageReordered(cb *func(TabView, uintptr, int)) uint {
1976 cbPtr := uintptr(unsafe.Pointer(cb))1996 cbPtr := uintptr(unsafe.Pointer(cb))
1977 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1997 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1978- return gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)1998+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)
1999+ glib.SaveHandlerMapping(handlerID, cbPtr)
2000+ return handlerID
1979 }2001 }
1980 2002
1981 fcb := func(clsPtr uintptr, PageVarp uintptr, PositionVarp int) {2003 fcb := func(clsPtr uintptr, PageVarp uintptr, PositionVarp int) {
@@ -1988,7 +2010,9 @@ func (x *TabView) ConnectPageReordered(cb *func(TabView, uintptr, int)) uint32 {
1988 }2010 }
1989 cbRefPtr := purego.NewCallback(fcb)2011 cbRefPtr := purego.NewCallback(fcb)
1990 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2012 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1991- return gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)2013+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)
2014+ glib.SaveHandlerMapping(handlerID, cbPtr)
2015+ return handlerID
1992 }2016 }
1993 2017
1994 // Emitted when a context menu is opened or closed for @page.2018 // Emitted when a context menu is opened or closed for @page.
@@ -1997,10 +2021,12 @@ func (x *TabView) ConnectPageReordered(cb *func(TabView, uintptr, int)) uint32 {
1997 //2021 //
1998 // It can be used to set up menu actions before showing the menu, for example2022 // It can be used to set up menu actions before showing the menu, for example
1999 // disable actions not applicable to @page.2023 // disable actions not applicable to @page.
2000-func (x *TabView) ConnectSetupMenu(cb *func(TabView, uintptr)) uint32 {2024+func (x *TabView) ConnectSetupMenu(cb *func(TabView, uintptr)) uint {
2001 cbPtr := uintptr(unsafe.Pointer(cb))2025 cbPtr := uintptr(unsafe.Pointer(cb))
2002 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2026 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2003- return gobject.SignalConnect(x.GoPointer(), "setup-menu", cbRefPtr)2027+ handlerID := gobject.SignalConnect(x.GoPointer(), "setup-menu", cbRefPtr)
2028+ glib.SaveHandlerMapping(handlerID, cbPtr)
2029+ return handlerID
2004 }2030 }
2005 2031
2006 fcb := func(clsPtr uintptr, PageVarp uintptr) {2032 fcb := func(clsPtr uintptr, PageVarp uintptr) {
@@ -2013,7 +2039,9 @@ func (x *TabView) ConnectSetupMenu(cb *func(TabView, uintptr)) uint32 {
2013 }2039 }
2014 cbRefPtr := purego.NewCallback(fcb)2040 cbRefPtr := purego.NewCallback(fcb)
2015 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2041 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2016- return gobject.SignalConnect(x.GoPointer(), "setup-menu", cbRefPtr)2042+ handlerID := gobject.SignalConnect(x.GoPointer(), "setup-menu", cbRefPtr)
2043+ glib.SaveHandlerMapping(handlerID, cbPtr)
2044+ return handlerID
2017 }2045 }
2018 2046
2019 // Requests the user's screen reader to announce the given message.2047 // Requests the user's screen reader to announce the given message.
M v4/adw/adw-toast.go +14 -6
@@ -656,10 +656,12 @@ func (x *Toast) GetPropertyUseMarkup() bool {
656 // Emitted after the button has been clicked.656 // Emitted after the button has been clicked.
657 //657 //
658 // It can be used as an alternative to setting an action.658 // It can be used as an alternative to setting an action.
659-func (x *Toast) ConnectButtonClicked(cb *func(Toast)) uint32 {659+func (x *Toast) ConnectButtonClicked(cb *func(Toast)) uint {
660 cbPtr := uintptr(unsafe.Pointer(cb))660 cbPtr := uintptr(unsafe.Pointer(cb))
661 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {661 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
662- return gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)662+ handlerID := gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)
663+ glib.SaveHandlerMapping(handlerID, cbPtr)
664+ return handlerID
663 }665 }
664 666
665 fcb := func(clsPtr uintptr) {667 fcb := func(clsPtr uintptr) {
@@ -672,14 +674,18 @@ func (x *Toast) ConnectButtonClicked(cb *func(Toast)) uint32 {
672 }674 }
673 cbRefPtr := purego.NewCallback(fcb)675 cbRefPtr := purego.NewCallback(fcb)
674 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)676 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
675- return gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)677+ handlerID := gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr)
678+ glib.SaveHandlerMapping(handlerID, cbPtr)
679+ return handlerID
676 }680 }
677 681
678 // Emitted when the toast has been dismissed.682 // Emitted when the toast has been dismissed.
679-func (x *Toast) ConnectDismissed(cb *func(Toast)) uint32 {683+func (x *Toast) ConnectDismissed(cb *func(Toast)) uint {
680 cbPtr := uintptr(unsafe.Pointer(cb))684 cbPtr := uintptr(unsafe.Pointer(cb))
681 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {685 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
682- return gobject.SignalConnect(x.GoPointer(), "dismissed", cbRefPtr)686+ handlerID := gobject.SignalConnect(x.GoPointer(), "dismissed", cbRefPtr)
687+ glib.SaveHandlerMapping(handlerID, cbPtr)
688+ return handlerID
683 }689 }
684 690
685 fcb := func(clsPtr uintptr) {691 fcb := func(clsPtr uintptr) {
@@ -692,7 +698,9 @@ func (x *Toast) ConnectDismissed(cb *func(Toast)) uint32 {
692 }698 }
693 cbRefPtr := purego.NewCallback(fcb)699 cbRefPtr := purego.NewCallback(fcb)
694 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)700 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
695- return gobject.SignalConnect(x.GoPointer(), "dismissed", cbRefPtr)701+ handlerID := gobject.SignalConnect(x.GoPointer(), "dismissed", cbRefPtr)
702+ glib.SaveHandlerMapping(handlerID, cbPtr)
703+ return handlerID
696 }704 }
697 705
698 func init() {706 func init() {
M v4/cairo/main.go +1 -1
@@ -185,7 +185,7 @@ func (x *RectangleInt) GoPointer() uintptr {
185 type Glyph struct {185 type Glyph struct {
186 _ structs.HostLayout186 _ structs.HostLayout
187 187
188- Index uint32188+ Index uint
189 189
190 X float64190 X float64
191 191
M v4/gdk/gdkclipboard.go +7 -3
@@ -456,10 +456,12 @@ func (x *Clipboard) GetPropertyLocal() bool {
456 }456 }
457 457
458 // Emitted when the clipboard changes ownership.458 // Emitted when the clipboard changes ownership.
459-func (x *Clipboard) ConnectChanged(cb *func(Clipboard)) uint32 {459+func (x *Clipboard) ConnectChanged(cb *func(Clipboard)) uint {
460 cbPtr := uintptr(unsafe.Pointer(cb))460 cbPtr := uintptr(unsafe.Pointer(cb))
461 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {461 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
462- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)462+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
463+ glib.SaveHandlerMapping(handlerID, cbPtr)
464+ return handlerID
463 }465 }
464 466
465 fcb := func(clsPtr uintptr) {467 fcb := func(clsPtr uintptr) {
@@ -472,7 +474,9 @@ func (x *Clipboard) ConnectChanged(cb *func(Clipboard)) uint32 {
472 }474 }
473 cbRefPtr := purego.NewCallback(fcb)475 cbRefPtr := purego.NewCallback(fcb)
474 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)476 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
475- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)477+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
478+ glib.SaveHandlerMapping(handlerID, cbPtr)
479+ return handlerID
476 }480 }
477 481
478 func init() {482 func init() {
M v4/gdk/gdkcontentprovider.go +7 -3
@@ -469,10 +469,12 @@ func (x *ContentProvider) GetPropertyStorableFormats() uintptr {
469 }469 }
470 470
471 // Emitted whenever the content provided by this provider has changed.471 // Emitted whenever the content provided by this provider has changed.
472-func (x *ContentProvider) ConnectContentChanged(cb *func(ContentProvider)) uint32 {472+func (x *ContentProvider) ConnectContentChanged(cb *func(ContentProvider)) uint {
473 cbPtr := uintptr(unsafe.Pointer(cb))473 cbPtr := uintptr(unsafe.Pointer(cb))
474 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {474 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
475- return gobject.SignalConnect(x.GoPointer(), "content-changed", cbRefPtr)475+ handlerID := gobject.SignalConnect(x.GoPointer(), "content-changed", cbRefPtr)
476+ glib.SaveHandlerMapping(handlerID, cbPtr)
477+ return handlerID
476 }478 }
477 479
478 fcb := func(clsPtr uintptr) {480 fcb := func(clsPtr uintptr) {
@@ -485,7 +487,9 @@ func (x *ContentProvider) ConnectContentChanged(cb *func(ContentProvider)) uint3
485 }487 }
486 cbRefPtr := purego.NewCallback(fcb)488 cbRefPtr := purego.NewCallback(fcb)
487 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)489 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
488- return gobject.SignalConnect(x.GoPointer(), "content-changed", cbRefPtr)490+ handlerID := gobject.SignalConnect(x.GoPointer(), "content-changed", cbRefPtr)
491+ glib.SaveHandlerMapping(handlerID, cbPtr)
492+ return handlerID
489 }493 }
490 494
491 func init() {495 func init() {
M v4/gdk/gdkdevice.go +14 -6
@@ -555,10 +555,12 @@ func (x *Device) GetPropertyVendorId() string {
555 // example, user switches from the USB mouse to a tablet); in555 // example, user switches from the USB mouse to a tablet); in
556 // that case the logical device will change to reflect the axes556 // that case the logical device will change to reflect the axes
557 // and keys on the new physical device.557 // and keys on the new physical device.
558-func (x *Device) ConnectChanged(cb *func(Device)) uint32 {558+func (x *Device) ConnectChanged(cb *func(Device)) uint {
559 cbPtr := uintptr(unsafe.Pointer(cb))559 cbPtr := uintptr(unsafe.Pointer(cb))
560 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {560 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
561- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)561+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
562+ glib.SaveHandlerMapping(handlerID, cbPtr)
563+ return handlerID
562 }564 }
563 565
564 fcb := func(clsPtr uintptr) {566 fcb := func(clsPtr uintptr) {
@@ -571,14 +573,18 @@ func (x *Device) ConnectChanged(cb *func(Device)) uint32 {
571 }573 }
572 cbRefPtr := purego.NewCallback(fcb)574 cbRefPtr := purego.NewCallback(fcb)
573 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)575 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
574- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)576+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
577+ glib.SaveHandlerMapping(handlerID, cbPtr)
578+ return handlerID
575 }579 }
576 580
577 // Emitted on pen/eraser devices whenever tools enter or leave proximity.581 // Emitted on pen/eraser devices whenever tools enter or leave proximity.
578-func (x *Device) ConnectToolChanged(cb *func(Device, uintptr)) uint32 {582+func (x *Device) ConnectToolChanged(cb *func(Device, uintptr)) uint {
579 cbPtr := uintptr(unsafe.Pointer(cb))583 cbPtr := uintptr(unsafe.Pointer(cb))
580 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {584 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
581- return gobject.SignalConnect(x.GoPointer(), "tool-changed", cbRefPtr)585+ handlerID := gobject.SignalConnect(x.GoPointer(), "tool-changed", cbRefPtr)
586+ glib.SaveHandlerMapping(handlerID, cbPtr)
587+ return handlerID
582 }588 }
583 589
584 fcb := func(clsPtr uintptr, ToolVarp uintptr) {590 fcb := func(clsPtr uintptr, ToolVarp uintptr) {
@@ -591,7 +597,9 @@ func (x *Device) ConnectToolChanged(cb *func(Device, uintptr)) uint32 {
591 }597 }
592 cbRefPtr := purego.NewCallback(fcb)598 cbRefPtr := purego.NewCallback(fcb)
593 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)599 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
594- return gobject.SignalConnect(x.GoPointer(), "tool-changed", cbRefPtr)600+ handlerID := gobject.SignalConnect(x.GoPointer(), "tool-changed", cbRefPtr)
601+ glib.SaveHandlerMapping(handlerID, cbPtr)
602+ return handlerID
595 }603 }
596 604
597 func init() {605 func init() {
M v4/gdk/gdkdisplay.go +35 -15
@@ -566,10 +566,12 @@ func (x *Display) GetPropertyShadowWidth() bool {
566 }566 }
567 567
568 // Emitted when the connection to the windowing system for @display is closed.568 // Emitted when the connection to the windowing system for @display is closed.
569-func (x *Display) ConnectClosed(cb *func(Display, bool)) uint32 {569+func (x *Display) ConnectClosed(cb *func(Display, bool)) uint {
570 cbPtr := uintptr(unsafe.Pointer(cb))570 cbPtr := uintptr(unsafe.Pointer(cb))
571 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {571 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
572- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)572+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
573+ glib.SaveHandlerMapping(handlerID, cbPtr)
574+ return handlerID
573 }575 }
574 576
575 fcb := func(clsPtr uintptr, IsErrorVarp bool) {577 fcb := func(clsPtr uintptr, IsErrorVarp bool) {
@@ -582,14 +584,18 @@ func (x *Display) ConnectClosed(cb *func(Display, bool)) uint32 {
582 }584 }
583 cbRefPtr := purego.NewCallback(fcb)585 cbRefPtr := purego.NewCallback(fcb)
584 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)586 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
585- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)587+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
588+ glib.SaveHandlerMapping(handlerID, cbPtr)
589+ return handlerID
586 }590 }
587 591
588 // Emitted when the connection to the windowing system for @display is opened.592 // Emitted when the connection to the windowing system for @display is opened.
589-func (x *Display) ConnectOpened(cb *func(Display)) uint32 {593+func (x *Display) ConnectOpened(cb *func(Display)) uint {
590 cbPtr := uintptr(unsafe.Pointer(cb))594 cbPtr := uintptr(unsafe.Pointer(cb))
591 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {595 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
592- return gobject.SignalConnect(x.GoPointer(), "opened", cbRefPtr)596+ handlerID := gobject.SignalConnect(x.GoPointer(), "opened", cbRefPtr)
597+ glib.SaveHandlerMapping(handlerID, cbPtr)
598+ return handlerID
593 }599 }
594 600
595 fcb := func(clsPtr uintptr) {601 fcb := func(clsPtr uintptr) {
@@ -602,14 +608,18 @@ func (x *Display) ConnectOpened(cb *func(Display)) uint32 {
602 }608 }
603 cbRefPtr := purego.NewCallback(fcb)609 cbRefPtr := purego.NewCallback(fcb)
604 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)610 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
605- return gobject.SignalConnect(x.GoPointer(), "opened", cbRefPtr)611+ handlerID := gobject.SignalConnect(x.GoPointer(), "opened", cbRefPtr)
612+ glib.SaveHandlerMapping(handlerID, cbPtr)
613+ return handlerID
606 }614 }
607 615
608 // Emitted whenever a new seat is made known to the windowing system.616 // Emitted whenever a new seat is made known to the windowing system.
609-func (x *Display) ConnectSeatAdded(cb *func(Display, uintptr)) uint32 {617+func (x *Display) ConnectSeatAdded(cb *func(Display, uintptr)) uint {
610 cbPtr := uintptr(unsafe.Pointer(cb))618 cbPtr := uintptr(unsafe.Pointer(cb))
611 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {619 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
612- return gobject.SignalConnect(x.GoPointer(), "seat-added", cbRefPtr)620+ handlerID := gobject.SignalConnect(x.GoPointer(), "seat-added", cbRefPtr)
621+ glib.SaveHandlerMapping(handlerID, cbPtr)
622+ return handlerID
613 }623 }
614 624
615 fcb := func(clsPtr uintptr, SeatVarp uintptr) {625 fcb := func(clsPtr uintptr, SeatVarp uintptr) {
@@ -622,14 +632,18 @@ func (x *Display) ConnectSeatAdded(cb *func(Display, uintptr)) uint32 {
622 }632 }
623 cbRefPtr := purego.NewCallback(fcb)633 cbRefPtr := purego.NewCallback(fcb)
624 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)634 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
625- return gobject.SignalConnect(x.GoPointer(), "seat-added", cbRefPtr)635+ handlerID := gobject.SignalConnect(x.GoPointer(), "seat-added", cbRefPtr)
636+ glib.SaveHandlerMapping(handlerID, cbPtr)
637+ return handlerID
626 }638 }
627 639
628 // Emitted whenever a seat is removed by the windowing system.640 // Emitted whenever a seat is removed by the windowing system.
629-func (x *Display) ConnectSeatRemoved(cb *func(Display, uintptr)) uint32 {641+func (x *Display) ConnectSeatRemoved(cb *func(Display, uintptr)) uint {
630 cbPtr := uintptr(unsafe.Pointer(cb))642 cbPtr := uintptr(unsafe.Pointer(cb))
631 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {643 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
632- return gobject.SignalConnect(x.GoPointer(), "seat-removed", cbRefPtr)644+ handlerID := gobject.SignalConnect(x.GoPointer(), "seat-removed", cbRefPtr)
645+ glib.SaveHandlerMapping(handlerID, cbPtr)
646+ return handlerID
633 }647 }
634 648
635 fcb := func(clsPtr uintptr, SeatVarp uintptr) {649 fcb := func(clsPtr uintptr, SeatVarp uintptr) {
@@ -642,14 +656,18 @@ func (x *Display) ConnectSeatRemoved(cb *func(Display, uintptr)) uint32 {
642 }656 }
643 cbRefPtr := purego.NewCallback(fcb)657 cbRefPtr := purego.NewCallback(fcb)
644 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)658 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
645- return gobject.SignalConnect(x.GoPointer(), "seat-removed", cbRefPtr)659+ handlerID := gobject.SignalConnect(x.GoPointer(), "seat-removed", cbRefPtr)
660+ glib.SaveHandlerMapping(handlerID, cbPtr)
661+ return handlerID
646 }662 }
647 663
648 // Emitted whenever a setting changes its value.664 // Emitted whenever a setting changes its value.
649-func (x *Display) ConnectSettingChanged(cb *func(Display, string)) uint32 {665+func (x *Display) ConnectSettingChanged(cb *func(Display, string)) uint {
650 cbPtr := uintptr(unsafe.Pointer(cb))666 cbPtr := uintptr(unsafe.Pointer(cb))
651 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {667 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
652- return gobject.SignalConnect(x.GoPointer(), "setting-changed", cbRefPtr)668+ handlerID := gobject.SignalConnect(x.GoPointer(), "setting-changed", cbRefPtr)
669+ glib.SaveHandlerMapping(handlerID, cbPtr)
670+ return handlerID
653 }671 }
654 672
655 fcb := func(clsPtr uintptr, SettingVarp string) {673 fcb := func(clsPtr uintptr, SettingVarp string) {
@@ -662,7 +680,9 @@ func (x *Display) ConnectSettingChanged(cb *func(Display, string)) uint32 {
662 }680 }
663 cbRefPtr := purego.NewCallback(fcb)681 cbRefPtr := purego.NewCallback(fcb)
664 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)682 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
665- return gobject.SignalConnect(x.GoPointer(), "setting-changed", cbRefPtr)683+ handlerID := gobject.SignalConnect(x.GoPointer(), "setting-changed", cbRefPtr)
684+ glib.SaveHandlerMapping(handlerID, cbPtr)
685+ return handlerID
666 }686 }
667 687
668 var xDisplayGetDefault func() uintptr688 var xDisplayGetDefault func() uintptr
M v4/gdk/gdkdisplaymanager.go +7 -3
@@ -187,10 +187,12 @@ func (c *DisplayManager) SetGoPointer(ptr uintptr) {
187 }187 }
188 188
189 // Emitted when a display is opened.189 // Emitted when a display is opened.
190-func (x *DisplayManager) ConnectDisplayOpened(cb *func(DisplayManager, uintptr)) uint32 {190+func (x *DisplayManager) ConnectDisplayOpened(cb *func(DisplayManager, uintptr)) uint {
191 cbPtr := uintptr(unsafe.Pointer(cb))191 cbPtr := uintptr(unsafe.Pointer(cb))
192 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {192 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
193- return gobject.SignalConnect(x.GoPointer(), "display-opened", cbRefPtr)193+ handlerID := gobject.SignalConnect(x.GoPointer(), "display-opened", cbRefPtr)
194+ glib.SaveHandlerMapping(handlerID, cbPtr)
195+ return handlerID
194 }196 }
195 197
196 fcb := func(clsPtr uintptr, DisplayVarp uintptr) {198 fcb := func(clsPtr uintptr, DisplayVarp uintptr) {
@@ -203,7 +205,9 @@ func (x *DisplayManager) ConnectDisplayOpened(cb *func(DisplayManager, uintptr))
203 }205 }
204 cbRefPtr := purego.NewCallback(fcb)206 cbRefPtr := purego.NewCallback(fcb)
205 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)207 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
206- return gobject.SignalConnect(x.GoPointer(), "display-opened", cbRefPtr)208+ handlerID := gobject.SignalConnect(x.GoPointer(), "display-opened", cbRefPtr)
209+ glib.SaveHandlerMapping(handlerID, cbPtr)
210+ return handlerID
207 }211 }
208 212
209 var xDisplayManagerGet func() uintptr213 var xDisplayManagerGet func() uintptr
M v4/gdk/gdkdrag.go +21 -9
@@ -251,10 +251,12 @@ func (x *Drag) GetPropertyFormats() uintptr {
251 }251 }
252 252
253 // Emitted when the drag operation is cancelled.253 // Emitted when the drag operation is cancelled.
254-func (x *Drag) ConnectCancel(cb *func(Drag, DragCancelReason)) uint32 {254+func (x *Drag) ConnectCancel(cb *func(Drag, DragCancelReason)) uint {
255 cbPtr := uintptr(unsafe.Pointer(cb))255 cbPtr := uintptr(unsafe.Pointer(cb))
256 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {256 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
257- return gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)257+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
258+ glib.SaveHandlerMapping(handlerID, cbPtr)
259+ return handlerID
258 }260 }
259 261
260 fcb := func(clsPtr uintptr, ReasonVarp DragCancelReason) {262 fcb := func(clsPtr uintptr, ReasonVarp DragCancelReason) {
@@ -267,16 +269,20 @@ func (x *Drag) ConnectCancel(cb *func(Drag, DragCancelReason)) uint32 {
267 }269 }
268 cbRefPtr := purego.NewCallback(fcb)270 cbRefPtr := purego.NewCallback(fcb)
269 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)271 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
270- return gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)272+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
273+ glib.SaveHandlerMapping(handlerID, cbPtr)
274+ return handlerID
271 }275 }
272 276
273 // Emitted when the destination side has finished reading all data.277 // Emitted when the destination side has finished reading all data.
274 //278 //
275 // The drag object can now free all miscellaneous data.279 // The drag object can now free all miscellaneous data.
276-func (x *Drag) ConnectDndFinished(cb *func(Drag)) uint32 {280+func (x *Drag) ConnectDndFinished(cb *func(Drag)) uint {
277 cbPtr := uintptr(unsafe.Pointer(cb))281 cbPtr := uintptr(unsafe.Pointer(cb))
278 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {282 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
279- return gobject.SignalConnect(x.GoPointer(), "dnd-finished", cbRefPtr)283+ handlerID := gobject.SignalConnect(x.GoPointer(), "dnd-finished", cbRefPtr)
284+ glib.SaveHandlerMapping(handlerID, cbPtr)
285+ return handlerID
280 }286 }
281 287
282 fcb := func(clsPtr uintptr) {288 fcb := func(clsPtr uintptr) {
@@ -289,14 +295,18 @@ func (x *Drag) ConnectDndFinished(cb *func(Drag)) uint32 {
289 }295 }
290 cbRefPtr := purego.NewCallback(fcb)296 cbRefPtr := purego.NewCallback(fcb)
291 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)297 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
292- return gobject.SignalConnect(x.GoPointer(), "dnd-finished", cbRefPtr)298+ handlerID := gobject.SignalConnect(x.GoPointer(), "dnd-finished", cbRefPtr)
299+ glib.SaveHandlerMapping(handlerID, cbPtr)
300+ return handlerID
293 }301 }
294 302
295 // Emitted when the drop operation is performed on an accepting client.303 // Emitted when the drop operation is performed on an accepting client.
296-func (x *Drag) ConnectDropPerformed(cb *func(Drag)) uint32 {304+func (x *Drag) ConnectDropPerformed(cb *func(Drag)) uint {
297 cbPtr := uintptr(unsafe.Pointer(cb))305 cbPtr := uintptr(unsafe.Pointer(cb))
298 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {306 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
299- return gobject.SignalConnect(x.GoPointer(), "drop-performed", cbRefPtr)307+ handlerID := gobject.SignalConnect(x.GoPointer(), "drop-performed", cbRefPtr)
308+ glib.SaveHandlerMapping(handlerID, cbPtr)
309+ return handlerID
300 }310 }
301 311
302 fcb := func(clsPtr uintptr) {312 fcb := func(clsPtr uintptr) {
@@ -309,7 +319,9 @@ func (x *Drag) ConnectDropPerformed(cb *func(Drag)) uint32 {
309 }319 }
310 cbRefPtr := purego.NewCallback(fcb)320 cbRefPtr := purego.NewCallback(fcb)
311 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)321 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
312- return gobject.SignalConnect(x.GoPointer(), "drop-performed", cbRefPtr)322+ handlerID := gobject.SignalConnect(x.GoPointer(), "drop-performed", cbRefPtr)
323+ glib.SaveHandlerMapping(handlerID, cbPtr)
324+ return handlerID
313 }325 }
314 326
315 var xDragBegin func(uintptr, uintptr, uintptr, DragAction, float64, float64) uintptr327 var xDragBegin func(uintptr, uintptr, uintptr, DragAction, float64, float64) uintptr
M v4/gdk/gdkframeclock.go +49 -21
@@ -261,10 +261,12 @@ func (c *FrameClock) SetGoPointer(ptr uintptr) {
261 // This signal ends processing of the frame.261 // This signal ends processing of the frame.
262 //262 //
263 // Applications should generally not handle this signal.263 // Applications should generally not handle this signal.
264-func (x *FrameClock) ConnectAfterPaint(cb *func(FrameClock)) uint32 {264+func (x *FrameClock) ConnectAfterPaint(cb *func(FrameClock)) uint {
265 cbPtr := uintptr(unsafe.Pointer(cb))265 cbPtr := uintptr(unsafe.Pointer(cb))
266 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {266 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
267- return gobject.SignalConnect(x.GoPointer(), "after-paint", cbRefPtr)267+ handlerID := gobject.SignalConnect(x.GoPointer(), "after-paint", cbRefPtr)
268+ glib.SaveHandlerMapping(handlerID, cbPtr)
269+ return handlerID
268 }270 }
269 271
270 fcb := func(clsPtr uintptr) {272 fcb := func(clsPtr uintptr) {
@@ -277,16 +279,20 @@ func (x *FrameClock) ConnectAfterPaint(cb *func(FrameClock)) uint32 {
277 }279 }
278 cbRefPtr := purego.NewCallback(fcb)280 cbRefPtr := purego.NewCallback(fcb)
279 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)281 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
280- return gobject.SignalConnect(x.GoPointer(), "after-paint", cbRefPtr)282+ handlerID := gobject.SignalConnect(x.GoPointer(), "after-paint", cbRefPtr)
283+ glib.SaveHandlerMapping(handlerID, cbPtr)
284+ return handlerID
281 }285 }
282 286
283 // Begins processing of the frame.287 // Begins processing of the frame.
284 //288 //
285 // Applications should generally not handle this signal.289 // Applications should generally not handle this signal.
286-func (x *FrameClock) ConnectBeforePaint(cb *func(FrameClock)) uint32 {290+func (x *FrameClock) ConnectBeforePaint(cb *func(FrameClock)) uint {
287 cbPtr := uintptr(unsafe.Pointer(cb))291 cbPtr := uintptr(unsafe.Pointer(cb))
288 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {292 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
289- return gobject.SignalConnect(x.GoPointer(), "before-paint", cbRefPtr)293+ handlerID := gobject.SignalConnect(x.GoPointer(), "before-paint", cbRefPtr)
294+ glib.SaveHandlerMapping(handlerID, cbPtr)
295+ return handlerID
290 }296 }
291 297
292 fcb := func(clsPtr uintptr) {298 fcb := func(clsPtr uintptr) {
@@ -299,17 +305,21 @@ func (x *FrameClock) ConnectBeforePaint(cb *func(FrameClock)) uint32 {
299 }305 }
300 cbRefPtr := purego.NewCallback(fcb)306 cbRefPtr := purego.NewCallback(fcb)
301 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)307 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
302- return gobject.SignalConnect(x.GoPointer(), "before-paint", cbRefPtr)308+ handlerID := gobject.SignalConnect(x.GoPointer(), "before-paint", cbRefPtr)
309+ glib.SaveHandlerMapping(handlerID, cbPtr)
310+ return handlerID
303 }311 }
304 312
305 // Used to flush pending motion events that are being batched up and313 // Used to flush pending motion events that are being batched up and
306 // compressed together.314 // compressed together.
307 //315 //
308 // Applications should not handle this signal.316 // Applications should not handle this signal.
309-func (x *FrameClock) ConnectFlushEvents(cb *func(FrameClock)) uint32 {317+func (x *FrameClock) ConnectFlushEvents(cb *func(FrameClock)) uint {
310 cbPtr := uintptr(unsafe.Pointer(cb))318 cbPtr := uintptr(unsafe.Pointer(cb))
311 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {319 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
312- return gobject.SignalConnect(x.GoPointer(), "flush-events", cbRefPtr)320+ handlerID := gobject.SignalConnect(x.GoPointer(), "flush-events", cbRefPtr)
321+ glib.SaveHandlerMapping(handlerID, cbPtr)
322+ return handlerID
313 }323 }
314 324
315 fcb := func(clsPtr uintptr) {325 fcb := func(clsPtr uintptr) {
@@ -322,7 +332,9 @@ func (x *FrameClock) ConnectFlushEvents(cb *func(FrameClock)) uint32 {
322 }332 }
323 cbRefPtr := purego.NewCallback(fcb)333 cbRefPtr := purego.NewCallback(fcb)
324 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)334 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
325- return gobject.SignalConnect(x.GoPointer(), "flush-events", cbRefPtr)335+ handlerID := gobject.SignalConnect(x.GoPointer(), "flush-events", cbRefPtr)
336+ glib.SaveHandlerMapping(handlerID, cbPtr)
337+ return handlerID
326 }338 }
327 339
328 // Emitted as the second step of toolkit and application processing340 // Emitted as the second step of toolkit and application processing
@@ -330,10 +342,12 @@ func (x *FrameClock) ConnectFlushEvents(cb *func(FrameClock)) uint32 {
330 //342 //
331 // Any work to update sizes and positions of application elements343 // Any work to update sizes and positions of application elements
332 // should be performed. GTK normally handles this internally.344 // should be performed. GTK normally handles this internally.
333-func (x *FrameClock) ConnectLayout(cb *func(FrameClock)) uint32 {345+func (x *FrameClock) ConnectLayout(cb *func(FrameClock)) uint {
334 cbPtr := uintptr(unsafe.Pointer(cb))346 cbPtr := uintptr(unsafe.Pointer(cb))
335 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {347 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
336- return gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)348+ handlerID := gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)
349+ glib.SaveHandlerMapping(handlerID, cbPtr)
350+ return handlerID
337 }351 }
338 352
339 fcb := func(clsPtr uintptr) {353 fcb := func(clsPtr uintptr) {
@@ -346,7 +360,9 @@ func (x *FrameClock) ConnectLayout(cb *func(FrameClock)) uint32 {
346 }360 }
347 cbRefPtr := purego.NewCallback(fcb)361 cbRefPtr := purego.NewCallback(fcb)
348 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)362 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
349- return gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)363+ handlerID := gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)
364+ glib.SaveHandlerMapping(handlerID, cbPtr)
365+ return handlerID
350 }366 }
351 367
352 // Emitted as the third step of toolkit and application processing368 // Emitted as the third step of toolkit and application processing
@@ -356,10 +372,12 @@ func (x *FrameClock) ConnectLayout(cb *func(FrameClock)) uint32 {
356 // emits [signal@Gdk.Surface::render] signals which are turned into372 // emits [signal@Gdk.Surface::render] signals which are turned into
357 // [GtkWidget::snapshot](../gtk4/signal.Widget.snapshot.html) signals373 // [GtkWidget::snapshot](../gtk4/signal.Widget.snapshot.html) signals
358 // by GTK.374 // by GTK.
359-func (x *FrameClock) ConnectPaint(cb *func(FrameClock)) uint32 {375+func (x *FrameClock) ConnectPaint(cb *func(FrameClock)) uint {
360 cbPtr := uintptr(unsafe.Pointer(cb))376 cbPtr := uintptr(unsafe.Pointer(cb))
361 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {377 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
362- return gobject.SignalConnect(x.GoPointer(), "paint", cbRefPtr)378+ handlerID := gobject.SignalConnect(x.GoPointer(), "paint", cbRefPtr)
379+ glib.SaveHandlerMapping(handlerID, cbPtr)
380+ return handlerID
363 }381 }
364 382
365 fcb := func(clsPtr uintptr) {383 fcb := func(clsPtr uintptr) {
@@ -372,17 +390,21 @@ func (x *FrameClock) ConnectPaint(cb *func(FrameClock)) uint32 {
372 }390 }
373 cbRefPtr := purego.NewCallback(fcb)391 cbRefPtr := purego.NewCallback(fcb)
374 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)392 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
375- return gobject.SignalConnect(x.GoPointer(), "paint", cbRefPtr)393+ handlerID := gobject.SignalConnect(x.GoPointer(), "paint", cbRefPtr)
394+ glib.SaveHandlerMapping(handlerID, cbPtr)
395+ return handlerID
376 }396 }
377 397
378 // Emitted after processing of the frame is finished.398 // Emitted after processing of the frame is finished.
379 //399 //
380 // This signal is handled internally by GTK to resume normal400 // This signal is handled internally by GTK to resume normal
381 // event processing. Applications should not handle this signal.401 // event processing. Applications should not handle this signal.
382-func (x *FrameClock) ConnectResumeEvents(cb *func(FrameClock)) uint32 {402+func (x *FrameClock) ConnectResumeEvents(cb *func(FrameClock)) uint {
383 cbPtr := uintptr(unsafe.Pointer(cb))403 cbPtr := uintptr(unsafe.Pointer(cb))
384 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {404 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
385- return gobject.SignalConnect(x.GoPointer(), "resume-events", cbRefPtr)405+ handlerID := gobject.SignalConnect(x.GoPointer(), "resume-events", cbRefPtr)
406+ glib.SaveHandlerMapping(handlerID, cbPtr)
407+ return handlerID
386 }408 }
387 409
388 fcb := func(clsPtr uintptr) {410 fcb := func(clsPtr uintptr) {
@@ -395,7 +417,9 @@ func (x *FrameClock) ConnectResumeEvents(cb *func(FrameClock)) uint32 {
395 }417 }
396 cbRefPtr := purego.NewCallback(fcb)418 cbRefPtr := purego.NewCallback(fcb)
397 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)419 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
398- return gobject.SignalConnect(x.GoPointer(), "resume-events", cbRefPtr)420+ handlerID := gobject.SignalConnect(x.GoPointer(), "resume-events", cbRefPtr)
421+ glib.SaveHandlerMapping(handlerID, cbPtr)
422+ return handlerID
399 }423 }
400 424
401 // Emitted as the first step of toolkit and application processing425 // Emitted as the first step of toolkit and application processing
@@ -405,10 +429,12 @@ func (x *FrameClock) ConnectResumeEvents(cb *func(FrameClock)) uint32 {
405 // Applications can connect directly to this signal, or use429 // Applications can connect directly to this signal, or use
406 // [gtk_widget_add_tick_callback()](../gtk4/method.Widget.add_tick_callback.html)430 // [gtk_widget_add_tick_callback()](../gtk4/method.Widget.add_tick_callback.html)
407 // as a more convenient interface.431 // as a more convenient interface.
408-func (x *FrameClock) ConnectUpdate(cb *func(FrameClock)) uint32 {432+func (x *FrameClock) ConnectUpdate(cb *func(FrameClock)) uint {
409 cbPtr := uintptr(unsafe.Pointer(cb))433 cbPtr := uintptr(unsafe.Pointer(cb))
410 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {434 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
411- return gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)435+ handlerID := gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)
436+ glib.SaveHandlerMapping(handlerID, cbPtr)
437+ return handlerID
412 }438 }
413 439
414 fcb := func(clsPtr uintptr) {440 fcb := func(clsPtr uintptr) {
@@ -421,7 +447,9 @@ func (x *FrameClock) ConnectUpdate(cb *func(FrameClock)) uint32 {
421 }447 }
422 cbRefPtr := purego.NewCallback(fcb)448 cbRefPtr := purego.NewCallback(fcb)
423 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)449 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
424- return gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)450+ handlerID := gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)
451+ glib.SaveHandlerMapping(handlerID, cbPtr)
452+ return handlerID
425 }453 }
426 454
427 func init() {455 func init() {
M v4/gdk/gdkmonitor.go +7 -3
@@ -344,10 +344,12 @@ func (x *Monitor) GetPropertyWidthMm() int {
344 }344 }
345 345
346 // Emitted when the output represented by @monitor gets disconnected.346 // Emitted when the output represented by @monitor gets disconnected.
347-func (x *Monitor) ConnectInvalidate(cb *func(Monitor)) uint32 {347+func (x *Monitor) ConnectInvalidate(cb *func(Monitor)) uint {
348 cbPtr := uintptr(unsafe.Pointer(cb))348 cbPtr := uintptr(unsafe.Pointer(cb))
349 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {349 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
350- return gobject.SignalConnect(x.GoPointer(), "invalidate", cbRefPtr)350+ handlerID := gobject.SignalConnect(x.GoPointer(), "invalidate", cbRefPtr)
351+ glib.SaveHandlerMapping(handlerID, cbPtr)
352+ return handlerID
351 }353 }
352 354
353 fcb := func(clsPtr uintptr) {355 fcb := func(clsPtr uintptr) {
@@ -360,7 +362,9 @@ func (x *Monitor) ConnectInvalidate(cb *func(Monitor)) uint32 {
360 }362 }
361 cbRefPtr := purego.NewCallback(fcb)363 cbRefPtr := purego.NewCallback(fcb)
362 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)364 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
363- return gobject.SignalConnect(x.GoPointer(), "invalidate", cbRefPtr)365+ handlerID := gobject.SignalConnect(x.GoPointer(), "invalidate", cbRefPtr)
366+ glib.SaveHandlerMapping(handlerID, cbPtr)
367+ return handlerID
364 }368 }
365 369
366 func init() {370 func init() {
M v4/gdk/gdkseat.go +28 -12
@@ -150,10 +150,12 @@ func (c *Seat) SetGoPointer(ptr uintptr) {
150 }150 }
151 151
152 // Emitted when a new input device is related to this seat.152 // Emitted when a new input device is related to this seat.
153-func (x *Seat) ConnectDeviceAdded(cb *func(Seat, uintptr)) uint32 {153+func (x *Seat) ConnectDeviceAdded(cb *func(Seat, uintptr)) uint {
154 cbPtr := uintptr(unsafe.Pointer(cb))154 cbPtr := uintptr(unsafe.Pointer(cb))
155 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {155 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
156- return gobject.SignalConnect(x.GoPointer(), "device-added", cbRefPtr)156+ handlerID := gobject.SignalConnect(x.GoPointer(), "device-added", cbRefPtr)
157+ glib.SaveHandlerMapping(handlerID, cbPtr)
158+ return handlerID
157 }159 }
158 160
159 fcb := func(clsPtr uintptr, DeviceVarp uintptr) {161 fcb := func(clsPtr uintptr, DeviceVarp uintptr) {
@@ -166,14 +168,18 @@ func (x *Seat) ConnectDeviceAdded(cb *func(Seat, uintptr)) uint32 {
166 }168 }
167 cbRefPtr := purego.NewCallback(fcb)169 cbRefPtr := purego.NewCallback(fcb)
168 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)170 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
169- return gobject.SignalConnect(x.GoPointer(), "device-added", cbRefPtr)171+ handlerID := gobject.SignalConnect(x.GoPointer(), "device-added", cbRefPtr)
172+ glib.SaveHandlerMapping(handlerID, cbPtr)
173+ return handlerID
170 }174 }
171 175
172 // Emitted when an input device is removed (e.g. unplugged).176 // Emitted when an input device is removed (e.g. unplugged).
173-func (x *Seat) ConnectDeviceRemoved(cb *func(Seat, uintptr)) uint32 {177+func (x *Seat) ConnectDeviceRemoved(cb *func(Seat, uintptr)) uint {
174 cbPtr := uintptr(unsafe.Pointer(cb))178 cbPtr := uintptr(unsafe.Pointer(cb))
175 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {179 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
176- return gobject.SignalConnect(x.GoPointer(), "device-removed", cbRefPtr)180+ handlerID := gobject.SignalConnect(x.GoPointer(), "device-removed", cbRefPtr)
181+ glib.SaveHandlerMapping(handlerID, cbPtr)
182+ return handlerID
177 }183 }
178 184
179 fcb := func(clsPtr uintptr, DeviceVarp uintptr) {185 fcb := func(clsPtr uintptr, DeviceVarp uintptr) {
@@ -186,7 +192,9 @@ func (x *Seat) ConnectDeviceRemoved(cb *func(Seat, uintptr)) uint32 {
186 }192 }
187 cbRefPtr := purego.NewCallback(fcb)193 cbRefPtr := purego.NewCallback(fcb)
188 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)194 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
189- return gobject.SignalConnect(x.GoPointer(), "device-removed", cbRefPtr)195+ handlerID := gobject.SignalConnect(x.GoPointer(), "device-removed", cbRefPtr)
196+ glib.SaveHandlerMapping(handlerID, cbPtr)
197+ return handlerID
190 }198 }
191 199
192 // Emitted whenever a new tool is made known to the seat.200 // Emitted whenever a new tool is made known to the seat.
@@ -196,10 +204,12 @@ func (x *Seat) ConnectDeviceRemoved(cb *func(Seat, uintptr)) uint32 {
196 // [signal@Gdk.Device::tool-changed] signal accordingly.204 // [signal@Gdk.Device::tool-changed] signal accordingly.
197 //205 //
198 // A same tool may be used by several devices.206 // A same tool may be used by several devices.
199-func (x *Seat) ConnectToolAdded(cb *func(Seat, uintptr)) uint32 {207+func (x *Seat) ConnectToolAdded(cb *func(Seat, uintptr)) uint {
200 cbPtr := uintptr(unsafe.Pointer(cb))208 cbPtr := uintptr(unsafe.Pointer(cb))
201 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {209 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
202- return gobject.SignalConnect(x.GoPointer(), "tool-added", cbRefPtr)210+ handlerID := gobject.SignalConnect(x.GoPointer(), "tool-added", cbRefPtr)
211+ glib.SaveHandlerMapping(handlerID, cbPtr)
212+ return handlerID
203 }213 }
204 214
205 fcb := func(clsPtr uintptr, ToolVarp uintptr) {215 fcb := func(clsPtr uintptr, ToolVarp uintptr) {
@@ -212,14 +222,18 @@ func (x *Seat) ConnectToolAdded(cb *func(Seat, uintptr)) uint32 {
212 }222 }
213 cbRefPtr := purego.NewCallback(fcb)223 cbRefPtr := purego.NewCallback(fcb)
214 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)224 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
215- return gobject.SignalConnect(x.GoPointer(), "tool-added", cbRefPtr)225+ handlerID := gobject.SignalConnect(x.GoPointer(), "tool-added", cbRefPtr)
226+ glib.SaveHandlerMapping(handlerID, cbPtr)
227+ return handlerID
216 }228 }
217 229
218 // Emitted whenever a tool is no longer known to this @seat.230 // Emitted whenever a tool is no longer known to this @seat.
219-func (x *Seat) ConnectToolRemoved(cb *func(Seat, uintptr)) uint32 {231+func (x *Seat) ConnectToolRemoved(cb *func(Seat, uintptr)) uint {
220 cbPtr := uintptr(unsafe.Pointer(cb))232 cbPtr := uintptr(unsafe.Pointer(cb))
221 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {233 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
222- return gobject.SignalConnect(x.GoPointer(), "tool-removed", cbRefPtr)234+ handlerID := gobject.SignalConnect(x.GoPointer(), "tool-removed", cbRefPtr)
235+ glib.SaveHandlerMapping(handlerID, cbPtr)
236+ return handlerID
223 }237 }
224 238
225 fcb := func(clsPtr uintptr, ToolVarp uintptr) {239 fcb := func(clsPtr uintptr, ToolVarp uintptr) {
@@ -232,7 +246,9 @@ func (x *Seat) ConnectToolRemoved(cb *func(Seat, uintptr)) uint32 {
232 }246 }
233 cbRefPtr := purego.NewCallback(fcb)247 cbRefPtr := purego.NewCallback(fcb)
234 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)248 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
235- return gobject.SignalConnect(x.GoPointer(), "tool-removed", cbRefPtr)249+ handlerID := gobject.SignalConnect(x.GoPointer(), "tool-removed", cbRefPtr)
250+ glib.SaveHandlerMapping(handlerID, cbPtr)
251+ return handlerID
236 }252 }
237 253
238 func init() {254 func init() {
M v4/gdk/gdksurface.go +35 -15
@@ -564,10 +564,12 @@ func (x *Surface) GetPropertyWidth() int {
564 }564 }
565 565
566 // Emitted when @surface starts being present on the monitor.566 // Emitted when @surface starts being present on the monitor.
567-func (x *Surface) ConnectEnterMonitor(cb *func(Surface, uintptr)) uint32 {567+func (x *Surface) ConnectEnterMonitor(cb *func(Surface, uintptr)) uint {
568 cbPtr := uintptr(unsafe.Pointer(cb))568 cbPtr := uintptr(unsafe.Pointer(cb))
569 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {569 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
570- return gobject.SignalConnect(x.GoPointer(), "enter-monitor", cbRefPtr)570+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter-monitor", cbRefPtr)
571+ glib.SaveHandlerMapping(handlerID, cbPtr)
572+ return handlerID
571 }573 }
572 574
573 fcb := func(clsPtr uintptr, MonitorVarp uintptr) {575 fcb := func(clsPtr uintptr, MonitorVarp uintptr) {
@@ -580,14 +582,18 @@ func (x *Surface) ConnectEnterMonitor(cb *func(Surface, uintptr)) uint32 {
580 }582 }
581 cbRefPtr := purego.NewCallback(fcb)583 cbRefPtr := purego.NewCallback(fcb)
582 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)584 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
583- return gobject.SignalConnect(x.GoPointer(), "enter-monitor", cbRefPtr)585+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter-monitor", cbRefPtr)
586+ glib.SaveHandlerMapping(handlerID, cbPtr)
587+ return handlerID
584 }588 }
585 589
586 // Emitted when GDK receives an input event for @surface.590 // Emitted when GDK receives an input event for @surface.
587-func (x *Surface) ConnectEvent(cb *func(Surface, *Event) bool) uint32 {591+func (x *Surface) ConnectEvent(cb *func(Surface, *Event) bool) uint {
588 cbPtr := uintptr(unsafe.Pointer(cb))592 cbPtr := uintptr(unsafe.Pointer(cb))
589 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {593 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
590- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)594+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
595+ glib.SaveHandlerMapping(handlerID, cbPtr)
596+ return handlerID
591 }597 }
592 598
593 fcb := func(clsPtr uintptr, EventVarp uintptr) bool {599 fcb := func(clsPtr uintptr, EventVarp uintptr) bool {
@@ -600,7 +606,9 @@ func (x *Surface) ConnectEvent(cb *func(Surface, *Event) bool) uint32 {
600 }606 }
601 cbRefPtr := purego.NewCallback(fcb)607 cbRefPtr := purego.NewCallback(fcb)
602 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)608 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
603- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)609+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
610+ glib.SaveHandlerMapping(handlerID, cbPtr)
611+ return handlerID
604 }612 }
605 613
606 // Emitted when the size of @surface is changed, or when relayout should614 // Emitted when the size of @surface is changed, or when relayout should
@@ -608,10 +616,12 @@ func (x *Surface) ConnectEvent(cb *func(Surface, *Event) bool) uint32 {
608 //616 //
609 // Surface size is reported in ”application pixels”, not617 // Surface size is reported in ”application pixels”, not
610 // ”device pixels” (see gdk_surface_get_scale_factor()).618 // ”device pixels” (see gdk_surface_get_scale_factor()).
611-func (x *Surface) ConnectLayout(cb *func(Surface, int, int)) uint32 {619+func (x *Surface) ConnectLayout(cb *func(Surface, int, int)) uint {
612 cbPtr := uintptr(unsafe.Pointer(cb))620 cbPtr := uintptr(unsafe.Pointer(cb))
613 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {621 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
614- return gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)622+ handlerID := gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)
623+ glib.SaveHandlerMapping(handlerID, cbPtr)
624+ return handlerID
615 }625 }
616 626
617 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {627 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {
@@ -624,14 +634,18 @@ func (x *Surface) ConnectLayout(cb *func(Surface, int, int)) uint32 {
624 }634 }
625 cbRefPtr := purego.NewCallback(fcb)635 cbRefPtr := purego.NewCallback(fcb)
626 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)636 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
627- return gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)637+ handlerID := gobject.SignalConnect(x.GoPointer(), "layout", cbRefPtr)
638+ glib.SaveHandlerMapping(handlerID, cbPtr)
639+ return handlerID
628 }640 }
629 641
630 // Emitted when @surface stops being present on the monitor.642 // Emitted when @surface stops being present on the monitor.
631-func (x *Surface) ConnectLeaveMonitor(cb *func(Surface, uintptr)) uint32 {643+func (x *Surface) ConnectLeaveMonitor(cb *func(Surface, uintptr)) uint {
632 cbPtr := uintptr(unsafe.Pointer(cb))644 cbPtr := uintptr(unsafe.Pointer(cb))
633 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {645 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
634- return gobject.SignalConnect(x.GoPointer(), "leave-monitor", cbRefPtr)646+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave-monitor", cbRefPtr)
647+ glib.SaveHandlerMapping(handlerID, cbPtr)
648+ return handlerID
635 }649 }
636 650
637 fcb := func(clsPtr uintptr, MonitorVarp uintptr) {651 fcb := func(clsPtr uintptr, MonitorVarp uintptr) {
@@ -644,14 +658,18 @@ func (x *Surface) ConnectLeaveMonitor(cb *func(Surface, uintptr)) uint32 {
644 }658 }
645 cbRefPtr := purego.NewCallback(fcb)659 cbRefPtr := purego.NewCallback(fcb)
646 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)660 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
647- return gobject.SignalConnect(x.GoPointer(), "leave-monitor", cbRefPtr)661+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave-monitor", cbRefPtr)
662+ glib.SaveHandlerMapping(handlerID, cbPtr)
663+ return handlerID
648 }664 }
649 665
650 // Emitted when part of the surface needs to be redrawn.666 // Emitted when part of the surface needs to be redrawn.
651-func (x *Surface) ConnectRender(cb *func(Surface, uintptr) bool) uint32 {667+func (x *Surface) ConnectRender(cb *func(Surface, uintptr) bool) uint {
652 cbPtr := uintptr(unsafe.Pointer(cb))668 cbPtr := uintptr(unsafe.Pointer(cb))
653 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {669 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
654- return gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)670+ handlerID := gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)
671+ glib.SaveHandlerMapping(handlerID, cbPtr)
672+ return handlerID
655 }673 }
656 674
657 fcb := func(clsPtr uintptr, RegionVarp uintptr) bool {675 fcb := func(clsPtr uintptr, RegionVarp uintptr) bool {
@@ -664,7 +682,9 @@ func (x *Surface) ConnectRender(cb *func(Surface, uintptr) bool) uint32 {
664 }682 }
665 cbRefPtr := purego.NewCallback(fcb)683 cbRefPtr := purego.NewCallback(fcb)
666 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)684 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
667- return gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)685+ handlerID := gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)
686+ glib.SaveHandlerMapping(handlerID, cbPtr)
687+ return handlerID
668 }688 }
669 689
670 func init() {690 func init() {
M v4/gdk/gdkvulkancontext.go +7 -3
@@ -60,10 +60,12 @@ func (c *VulkanContext) SetGoPointer(ptr uintptr) {
60 //60 //
61 // Usually this means that the swapchain had to be recreated,61 // Usually this means that the swapchain had to be recreated,
62 // for example in response to a change of the surface size.62 // for example in response to a change of the surface size.
63-func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint32 {63+func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint {
64 cbPtr := uintptr(unsafe.Pointer(cb))64 cbPtr := uintptr(unsafe.Pointer(cb))
65 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {65 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
66- return gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)66+ handlerID := gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)
67+ glib.SaveHandlerMapping(handlerID, cbPtr)
68+ return handlerID
67 }69 }
68 70
69 fcb := func(clsPtr uintptr) {71 fcb := func(clsPtr uintptr) {
@@ -76,7 +78,9 @@ func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint32 {
76 }78 }
77 cbRefPtr := purego.NewCallback(fcb)79 cbRefPtr := purego.NewCallback(fcb)
78 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)80 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
79- return gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)81+ handlerID := gobject.SignalConnect(x.GoPointer(), "images-updated", cbRefPtr)
82+ glib.SaveHandlerMapping(handlerID, cbPtr)
83+ return handlerID
80 }84 }
81 85
82 func init() {86 func init() {
M v4/gdkpixbuf/gdk-pixbuf-loader.go +28 -12
@@ -426,10 +426,12 @@ func (c *PixbufLoader) SetGoPointer(ptr uintptr) {
426 // After this signal is emitted, applications can call426 // After this signal is emitted, applications can call
427 // gdk_pixbuf_loader_get_pixbuf() to fetch the partially-loaded427 // gdk_pixbuf_loader_get_pixbuf() to fetch the partially-loaded
428 // pixbuf.428 // pixbuf.
429-func (x *PixbufLoader) ConnectAreaPrepared(cb *func(PixbufLoader)) uint32 {429+func (x *PixbufLoader) ConnectAreaPrepared(cb *func(PixbufLoader)) uint {
430 cbPtr := uintptr(unsafe.Pointer(cb))430 cbPtr := uintptr(unsafe.Pointer(cb))
431 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {431 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
432- return gobject.SignalConnect(x.GoPointer(), "area-prepared", cbRefPtr)432+ handlerID := gobject.SignalConnect(x.GoPointer(), "area-prepared", cbRefPtr)
433+ glib.SaveHandlerMapping(handlerID, cbPtr)
434+ return handlerID
433 }435 }
434 436
435 fcb := func(clsPtr uintptr) {437 fcb := func(clsPtr uintptr) {
@@ -442,7 +444,9 @@ func (x *PixbufLoader) ConnectAreaPrepared(cb *func(PixbufLoader)) uint32 {
442 }444 }
443 cbRefPtr := purego.NewCallback(fcb)445 cbRefPtr := purego.NewCallback(fcb)
444 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)446 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
445- return gobject.SignalConnect(x.GoPointer(), "area-prepared", cbRefPtr)447+ handlerID := gobject.SignalConnect(x.GoPointer(), "area-prepared", cbRefPtr)
448+ glib.SaveHandlerMapping(handlerID, cbPtr)
449+ return handlerID
446 }450 }
447 451
448 // This signal is emitted when a significant area of the image being452 // This signal is emitted when a significant area of the image being
@@ -453,10 +457,12 @@ func (x *PixbufLoader) ConnectAreaPrepared(cb *func(PixbufLoader)) uint32 {
453 //457 //
454 // Applications can use this signal to know when to repaint458 // Applications can use this signal to know when to repaint
455 // areas of an image that is being loaded.459 // areas of an image that is being loaded.
456-func (x *PixbufLoader) ConnectAreaUpdated(cb *func(PixbufLoader, int, int, int, int)) uint32 {460+func (x *PixbufLoader) ConnectAreaUpdated(cb *func(PixbufLoader, int, int, int, int)) uint {
457 cbPtr := uintptr(unsafe.Pointer(cb))461 cbPtr := uintptr(unsafe.Pointer(cb))
458 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {462 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
459- return gobject.SignalConnect(x.GoPointer(), "area-updated", cbRefPtr)463+ handlerID := gobject.SignalConnect(x.GoPointer(), "area-updated", cbRefPtr)
464+ glib.SaveHandlerMapping(handlerID, cbPtr)
465+ return handlerID
460 }466 }
461 467
462 fcb := func(clsPtr uintptr, XVarp int, YVarp int, WidthVarp int, HeightVarp int) {468 fcb := func(clsPtr uintptr, XVarp int, YVarp int, WidthVarp int, HeightVarp int) {
@@ -469,7 +475,9 @@ func (x *PixbufLoader) ConnectAreaUpdated(cb *func(PixbufLoader, int, int, int,
469 }475 }
470 cbRefPtr := purego.NewCallback(fcb)476 cbRefPtr := purego.NewCallback(fcb)
471 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)477 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
472- return gobject.SignalConnect(x.GoPointer(), "area-updated", cbRefPtr)478+ handlerID := gobject.SignalConnect(x.GoPointer(), "area-updated", cbRefPtr)
479+ glib.SaveHandlerMapping(handlerID, cbPtr)
480+ return handlerID
473 }481 }
474 482
475 // This signal is emitted when gdk_pixbuf_loader_close() is called.483 // This signal is emitted when gdk_pixbuf_loader_close() is called.
@@ -477,10 +485,12 @@ func (x *PixbufLoader) ConnectAreaUpdated(cb *func(PixbufLoader, int, int, int,
477 // It can be used by different parts of an application to receive485 // It can be used by different parts of an application to receive
478 // notification when an image loader is closed by the code that486 // notification when an image loader is closed by the code that
479 // drives it.487 // drives it.
480-func (x *PixbufLoader) ConnectClosed(cb *func(PixbufLoader)) uint32 {488+func (x *PixbufLoader) ConnectClosed(cb *func(PixbufLoader)) uint {
481 cbPtr := uintptr(unsafe.Pointer(cb))489 cbPtr := uintptr(unsafe.Pointer(cb))
482 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {490 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
483- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)491+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
492+ glib.SaveHandlerMapping(handlerID, cbPtr)
493+ return handlerID
484 }494 }
485 495
486 fcb := func(clsPtr uintptr) {496 fcb := func(clsPtr uintptr) {
@@ -493,7 +503,9 @@ func (x *PixbufLoader) ConnectClosed(cb *func(PixbufLoader)) uint32 {
493 }503 }
494 cbRefPtr := purego.NewCallback(fcb)504 cbRefPtr := purego.NewCallback(fcb)
495 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)505 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
496- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)506+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
507+ glib.SaveHandlerMapping(handlerID, cbPtr)
508+ return handlerID
497 }509 }
498 510
499 // This signal is emitted when the pixbuf loader has been fed the511 // This signal is emitted when the pixbuf loader has been fed the
@@ -503,10 +515,12 @@ func (x *PixbufLoader) ConnectClosed(cb *func(PixbufLoader)) uint32 {
503 // Applications can call gdk_pixbuf_loader_set_size() in response515 // Applications can call gdk_pixbuf_loader_set_size() in response
504 // to this signal to set the desired size to which the image516 // to this signal to set the desired size to which the image
505 // should be scaled.517 // should be scaled.
506-func (x *PixbufLoader) ConnectSizePrepared(cb *func(PixbufLoader, int, int)) uint32 {518+func (x *PixbufLoader) ConnectSizePrepared(cb *func(PixbufLoader, int, int)) uint {
507 cbPtr := uintptr(unsafe.Pointer(cb))519 cbPtr := uintptr(unsafe.Pointer(cb))
508 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {520 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
509- return gobject.SignalConnect(x.GoPointer(), "size-prepared", cbRefPtr)521+ handlerID := gobject.SignalConnect(x.GoPointer(), "size-prepared", cbRefPtr)
522+ glib.SaveHandlerMapping(handlerID, cbPtr)
523+ return handlerID
510 }524 }
511 525
512 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {526 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {
@@ -519,7 +533,9 @@ func (x *PixbufLoader) ConnectSizePrepared(cb *func(PixbufLoader, int, int)) uin
519 }533 }
520 cbRefPtr := purego.NewCallback(fcb)534 cbRefPtr := purego.NewCallback(fcb)
521 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)535 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
522- return gobject.SignalConnect(x.GoPointer(), "size-prepared", cbRefPtr)536+ handlerID := gobject.SignalConnect(x.GoPointer(), "size-prepared", cbRefPtr)
537+ glib.SaveHandlerMapping(handlerID, cbPtr)
538+ return handlerID
523 }539 }
524 540
525 func init() {541 func init() {
M v4/gio/gappinfo.go +28 -12
@@ -1840,10 +1840,12 @@ func (c *AppInfoMonitor) SetGoPointer(ptr uintptr) {
1840 1840
1841 // Signal emitted when the app info database changes, when applications are1841 // Signal emitted when the app info database changes, when applications are
1842 // installed or removed.1842 // installed or removed.
1843-func (x *AppInfoMonitor) ConnectChanged(cb *func(AppInfoMonitor)) uint32 {1843+func (x *AppInfoMonitor) ConnectChanged(cb *func(AppInfoMonitor)) uint {
1844 cbPtr := uintptr(unsafe.Pointer(cb))1844 cbPtr := uintptr(unsafe.Pointer(cb))
1845 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1845 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1846- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)1846+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1847+ glib.SaveHandlerMapping(handlerID, cbPtr)
1848+ return handlerID
1847 }1849 }
1848 1850
1849 fcb := func(clsPtr uintptr) {1851 fcb := func(clsPtr uintptr) {
@@ -1856,7 +1858,9 @@ func (x *AppInfoMonitor) ConnectChanged(cb *func(AppInfoMonitor)) uint32 {
1856 }1858 }
1857 cbRefPtr := purego.NewCallback(fcb)1859 cbRefPtr := purego.NewCallback(fcb)
1858 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1860 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1859- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)1861+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1862+ glib.SaveHandlerMapping(handlerID, cbPtr)
1863+ return handlerID
1860 }1864 }
1861 1865
1862 var xAppInfoMonitorGet func() uintptr1866 var xAppInfoMonitorGet func() uintptr
@@ -2022,10 +2026,12 @@ func (c *AppLaunchContext) SetGoPointer(ptr uintptr) {
2022 // Because a launch operation may involve spawning multiple instances of the2026 // Because a launch operation may involve spawning multiple instances of the
2023 // target application, you should expect this signal to be emitted multiple2027 // target application, you should expect this signal to be emitted multiple
2024 // times, one for each spawned instance.2028 // times, one for each spawned instance.
2025-func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string)) uint32 {2029+func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string)) uint {
2026 cbPtr := uintptr(unsafe.Pointer(cb))2030 cbPtr := uintptr(unsafe.Pointer(cb))
2027 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2031 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2028- return gobject.SignalConnect(x.GoPointer(), "launch-failed", cbRefPtr)2032+ handlerID := gobject.SignalConnect(x.GoPointer(), "launch-failed", cbRefPtr)
2033+ glib.SaveHandlerMapping(handlerID, cbPtr)
2034+ return handlerID
2029 }2035 }
2030 2036
2031 fcb := func(clsPtr uintptr, StartupNotifyIdVarp string) {2037 fcb := func(clsPtr uintptr, StartupNotifyIdVarp string) {
@@ -2038,7 +2044,9 @@ func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string
2038 }2044 }
2039 cbRefPtr := purego.NewCallback(fcb)2045 cbRefPtr := purego.NewCallback(fcb)
2040 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2046 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2041- return gobject.SignalConnect(x.GoPointer(), "launch-failed", cbRefPtr)2047+ handlerID := gobject.SignalConnect(x.GoPointer(), "launch-failed", cbRefPtr)
2048+ glib.SaveHandlerMapping(handlerID, cbPtr)
2049+ return handlerID
2042 }2050 }
2043 2051
2044 // The [signal@Gio.AppLaunchContext::launch-started] signal is emitted when a2052 // The [signal@Gio.AppLaunchContext::launch-started] signal is emitted when a
@@ -2060,10 +2068,12 @@ func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string
2060 // Because a launch operation may involve spawning multiple instances of the2068 // Because a launch operation may involve spawning multiple instances of the
2061 // target application, you should expect this signal to be emitted multiple2069 // target application, you should expect this signal to be emitted multiple
2062 // times, one for each spawned instance.2070 // times, one for each spawned instance.
2063-func (x *AppLaunchContext) ConnectLaunchStarted(cb *func(AppLaunchContext, uintptr, uintptr)) uint32 {2071+func (x *AppLaunchContext) ConnectLaunchStarted(cb *func(AppLaunchContext, uintptr, uintptr)) uint {
2064 cbPtr := uintptr(unsafe.Pointer(cb))2072 cbPtr := uintptr(unsafe.Pointer(cb))
2065 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2073 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2066- return gobject.SignalConnect(x.GoPointer(), "launch-started", cbRefPtr)2074+ handlerID := gobject.SignalConnect(x.GoPointer(), "launch-started", cbRefPtr)
2075+ glib.SaveHandlerMapping(handlerID, cbPtr)
2076+ return handlerID
2067 }2077 }
2068 2078
2069 fcb := func(clsPtr uintptr, InfoVarp uintptr, PlatformDataVarp uintptr) {2079 fcb := func(clsPtr uintptr, InfoVarp uintptr, PlatformDataVarp uintptr) {
@@ -2076,7 +2086,9 @@ func (x *AppLaunchContext) ConnectLaunchStarted(cb *func(AppLaunchContext, uintp
2076 }2086 }
2077 cbRefPtr := purego.NewCallback(fcb)2087 cbRefPtr := purego.NewCallback(fcb)
2078 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2088 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2079- return gobject.SignalConnect(x.GoPointer(), "launch-started", cbRefPtr)2089+ handlerID := gobject.SignalConnect(x.GoPointer(), "launch-started", cbRefPtr)
2090+ glib.SaveHandlerMapping(handlerID, cbPtr)
2091+ return handlerID
2080 }2092 }
2081 2093
2082 // The [signal@Gio.AppLaunchContext::launched] signal is emitted when a2094 // The [signal@Gio.AppLaunchContext::launched] signal is emitted when a
@@ -2100,10 +2112,12 @@ func (x *AppLaunchContext) ConnectLaunchStarted(cb *func(AppLaunchContext, uintp
2100 // is emitted, GLib will call [func@GLib.spawn_close_pid]. If you need to2112 // is emitted, GLib will call [func@GLib.spawn_close_pid]. If you need to
2101 // keep the [alias@GLib.Pid] after the signal has been emitted, then you can2113 // keep the [alias@GLib.Pid] after the signal has been emitted, then you can
2102 // duplicate `pid` using `DuplicateHandle()`.2114 // duplicate `pid` using `DuplicateHandle()`.
2103-func (x *AppLaunchContext) ConnectLaunched(cb *func(AppLaunchContext, uintptr, uintptr)) uint32 {2115+func (x *AppLaunchContext) ConnectLaunched(cb *func(AppLaunchContext, uintptr, uintptr)) uint {
2104 cbPtr := uintptr(unsafe.Pointer(cb))2116 cbPtr := uintptr(unsafe.Pointer(cb))
2105 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2117 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2106- return gobject.SignalConnect(x.GoPointer(), "launched", cbRefPtr)2118+ handlerID := gobject.SignalConnect(x.GoPointer(), "launched", cbRefPtr)
2119+ glib.SaveHandlerMapping(handlerID, cbPtr)
2120+ return handlerID
2107 }2121 }
2108 2122
2109 fcb := func(clsPtr uintptr, InfoVarp uintptr, PlatformDataVarp uintptr) {2123 fcb := func(clsPtr uintptr, InfoVarp uintptr, PlatformDataVarp uintptr) {
@@ -2116,7 +2130,9 @@ func (x *AppLaunchContext) ConnectLaunched(cb *func(AppLaunchContext, uintptr, u
2116 }2130 }
2117 cbRefPtr := purego.NewCallback(fcb)2131 cbRefPtr := purego.NewCallback(fcb)
2118 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2132 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2119- return gobject.SignalConnect(x.GoPointer(), "launched", cbRefPtr)2133+ handlerID := gobject.SignalConnect(x.GoPointer(), "launched", cbRefPtr)
2134+ glib.SaveHandlerMapping(handlerID, cbPtr)
2135+ return handlerID
2120 }2136 }
2121 2137
2122 func init() {2138 func init() {
M v4/gio/gapplication.go +49 -21
@@ -1571,10 +1571,12 @@ func (x *Application) GetPropertyVersion() string {
1571 1571
1572 // The ::activate signal is emitted on the primary instance when an1572 // The ::activate signal is emitted on the primary instance when an
1573 // activation occurs. See g_application_activate().1573 // activation occurs. See g_application_activate().
1574-func (x *Application) ConnectActivate(cb *func(Application)) uint32 {1574+func (x *Application) ConnectActivate(cb *func(Application)) uint {
1575 cbPtr := uintptr(unsafe.Pointer(cb))1575 cbPtr := uintptr(unsafe.Pointer(cb))
1576 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1576 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1577- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1577+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1578+ glib.SaveHandlerMapping(handlerID, cbPtr)
1579+ return handlerID
1578 }1580 }
1579 1581
1580 fcb := func(clsPtr uintptr) {1582 fcb := func(clsPtr uintptr) {
@@ -1587,16 +1589,20 @@ func (x *Application) ConnectActivate(cb *func(Application)) uint32 {
1587 }1589 }
1588 cbRefPtr := purego.NewCallback(fcb)1590 cbRefPtr := purego.NewCallback(fcb)
1589 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1591 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1590- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1592+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1593+ glib.SaveHandlerMapping(handlerID, cbPtr)
1594+ return handlerID
1591 }1595 }
1592 1596
1593 // The ::command-line signal is emitted on the primary instance when1597 // The ::command-line signal is emitted on the primary instance when
1594 // a commandline is not handled locally. See g_application_run() and1598 // a commandline is not handled locally. See g_application_run() and
1595 // the #GApplicationCommandLine documentation for more information.1599 // the #GApplicationCommandLine documentation for more information.
1596-func (x *Application) ConnectCommandLine(cb *func(Application, uintptr) int) uint32 {1600+func (x *Application) ConnectCommandLine(cb *func(Application, uintptr) int) uint {
1597 cbPtr := uintptr(unsafe.Pointer(cb))1601 cbPtr := uintptr(unsafe.Pointer(cb))
1598 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1602 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1599- return gobject.SignalConnect(x.GoPointer(), "command-line", cbRefPtr)1603+ handlerID := gobject.SignalConnect(x.GoPointer(), "command-line", cbRefPtr)
1604+ glib.SaveHandlerMapping(handlerID, cbPtr)
1605+ return handlerID
1600 }1606 }
1601 1607
1602 fcb := func(clsPtr uintptr, CommandLineVarp uintptr) int {1608 fcb := func(clsPtr uintptr, CommandLineVarp uintptr) int {
@@ -1609,7 +1615,9 @@ func (x *Application) ConnectCommandLine(cb *func(Application, uintptr) int) uin
1609 }1615 }
1610 cbRefPtr := purego.NewCallback(fcb)1616 cbRefPtr := purego.NewCallback(fcb)
1611 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1617 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1612- return gobject.SignalConnect(x.GoPointer(), "command-line", cbRefPtr)1618+ handlerID := gobject.SignalConnect(x.GoPointer(), "command-line", cbRefPtr)
1619+ glib.SaveHandlerMapping(handlerID, cbPtr)
1620+ return handlerID
1613 }1621 }
1614 1622
1615 // The ::handle-local-options signal is emitted on the local instance1623 // The ::handle-local-options signal is emitted on the local instance
@@ -1653,10 +1661,12 @@ func (x *Application) ConnectCommandLine(cb *func(Application, uintptr) int) uin
1653 // You can override local_command_line() if you need more powerful1661 // You can override local_command_line() if you need more powerful
1654 // capabilities than what is provided here, but this should not1662 // capabilities than what is provided here, but this should not
1655 // normally be required.1663 // normally be required.
1656-func (x *Application) ConnectHandleLocalOptions(cb *func(Application, uintptr) int) uint32 {1664+func (x *Application) ConnectHandleLocalOptions(cb *func(Application, uintptr) int) uint {
1657 cbPtr := uintptr(unsafe.Pointer(cb))1665 cbPtr := uintptr(unsafe.Pointer(cb))
1658 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1666 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1659- return gobject.SignalConnect(x.GoPointer(), "handle-local-options", cbRefPtr)1667+ handlerID := gobject.SignalConnect(x.GoPointer(), "handle-local-options", cbRefPtr)
1668+ glib.SaveHandlerMapping(handlerID, cbPtr)
1669+ return handlerID
1660 }1670 }
1661 1671
1662 fcb := func(clsPtr uintptr, OptionsVarp uintptr) int {1672 fcb := func(clsPtr uintptr, OptionsVarp uintptr) int {
@@ -1669,7 +1679,9 @@ func (x *Application) ConnectHandleLocalOptions(cb *func(Application, uintptr) i
1669 }1679 }
1670 cbRefPtr := purego.NewCallback(fcb)1680 cbRefPtr := purego.NewCallback(fcb)
1671 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1681 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1672- return gobject.SignalConnect(x.GoPointer(), "handle-local-options", cbRefPtr)1682+ handlerID := gobject.SignalConnect(x.GoPointer(), "handle-local-options", cbRefPtr)
1683+ glib.SaveHandlerMapping(handlerID, cbPtr)
1684+ return handlerID
1673 }1685 }
1674 1686
1675 // The ::name-lost signal is emitted only on the registered primary instance1687 // The ::name-lost signal is emitted only on the registered primary instance
@@ -1677,10 +1689,12 @@ func (x *Application) ConnectHandleLocalOptions(cb *func(Application, uintptr) i
1677 // is using the %G_APPLICATION_ALLOW_REPLACEMENT flag.1689 // is using the %G_APPLICATION_ALLOW_REPLACEMENT flag.
1678 //1690 //
1679 // The default handler for this signal calls g_application_quit().1691 // The default handler for this signal calls g_application_quit().
1680-func (x *Application) ConnectNameLost(cb *func(Application) bool) uint32 {1692+func (x *Application) ConnectNameLost(cb *func(Application) bool) uint {
1681 cbPtr := uintptr(unsafe.Pointer(cb))1693 cbPtr := uintptr(unsafe.Pointer(cb))
1682 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1694 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1683- return gobject.SignalConnect(x.GoPointer(), "name-lost", cbRefPtr)1695+ handlerID := gobject.SignalConnect(x.GoPointer(), "name-lost", cbRefPtr)
1696+ glib.SaveHandlerMapping(handlerID, cbPtr)
1697+ return handlerID
1684 }1698 }
1685 1699
1686 fcb := func(clsPtr uintptr) bool {1700 fcb := func(clsPtr uintptr) bool {
@@ -1693,15 +1707,19 @@ func (x *Application) ConnectNameLost(cb *func(Application) bool) uint32 {
1693 }1707 }
1694 cbRefPtr := purego.NewCallback(fcb)1708 cbRefPtr := purego.NewCallback(fcb)
1695 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1709 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1696- return gobject.SignalConnect(x.GoPointer(), "name-lost", cbRefPtr)1710+ handlerID := gobject.SignalConnect(x.GoPointer(), "name-lost", cbRefPtr)
1711+ glib.SaveHandlerMapping(handlerID, cbPtr)
1712+ return handlerID
1697 }1713 }
1698 1714
1699 // The ::open signal is emitted on the primary instance when there are1715 // The ::open signal is emitted on the primary instance when there are
1700 // files to open. See g_application_open() for more information.1716 // files to open. See g_application_open() for more information.
1701-func (x *Application) ConnectOpen(cb *func(Application, uintptr, int, string)) uint32 {1717+func (x *Application) ConnectOpen(cb *func(Application, uintptr, int, string)) uint {
1702 cbPtr := uintptr(unsafe.Pointer(cb))1718 cbPtr := uintptr(unsafe.Pointer(cb))
1703 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1719 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1704- return gobject.SignalConnect(x.GoPointer(), "open", cbRefPtr)1720+ handlerID := gobject.SignalConnect(x.GoPointer(), "open", cbRefPtr)
1721+ glib.SaveHandlerMapping(handlerID, cbPtr)
1722+ return handlerID
1705 }1723 }
1706 1724
1707 fcb := func(clsPtr uintptr, FilesVarp uintptr, NFilesVarp int, HintVarp string) {1725 fcb := func(clsPtr uintptr, FilesVarp uintptr, NFilesVarp int, HintVarp string) {
@@ -1714,15 +1732,19 @@ func (x *Application) ConnectOpen(cb *func(Application, uintptr, int, string)) u
1714 }1732 }
1715 cbRefPtr := purego.NewCallback(fcb)1733 cbRefPtr := purego.NewCallback(fcb)
1716 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1734 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1717- return gobject.SignalConnect(x.GoPointer(), "open", cbRefPtr)1735+ handlerID := gobject.SignalConnect(x.GoPointer(), "open", cbRefPtr)
1736+ glib.SaveHandlerMapping(handlerID, cbPtr)
1737+ return handlerID
1718 }1738 }
1719 1739
1720 // The ::shutdown signal is emitted only on the registered primary instance1740 // The ::shutdown signal is emitted only on the registered primary instance
1721 // immediately after the main loop terminates.1741 // immediately after the main loop terminates.
1722-func (x *Application) ConnectShutdown(cb *func(Application)) uint32 {1742+func (x *Application) ConnectShutdown(cb *func(Application)) uint {
1723 cbPtr := uintptr(unsafe.Pointer(cb))1743 cbPtr := uintptr(unsafe.Pointer(cb))
1724 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1744 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1725- return gobject.SignalConnect(x.GoPointer(), "shutdown", cbRefPtr)1745+ handlerID := gobject.SignalConnect(x.GoPointer(), "shutdown", cbRefPtr)
1746+ glib.SaveHandlerMapping(handlerID, cbPtr)
1747+ return handlerID
1726 }1748 }
1727 1749
1728 fcb := func(clsPtr uintptr) {1750 fcb := func(clsPtr uintptr) {
@@ -1735,15 +1757,19 @@ func (x *Application) ConnectShutdown(cb *func(Application)) uint32 {
1735 }1757 }
1736 cbRefPtr := purego.NewCallback(fcb)1758 cbRefPtr := purego.NewCallback(fcb)
1737 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1759 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1738- return gobject.SignalConnect(x.GoPointer(), "shutdown", cbRefPtr)1760+ handlerID := gobject.SignalConnect(x.GoPointer(), "shutdown", cbRefPtr)
1761+ glib.SaveHandlerMapping(handlerID, cbPtr)
1762+ return handlerID
1739 }1763 }
1740 1764
1741 // The ::startup signal is emitted on the primary instance immediately1765 // The ::startup signal is emitted on the primary instance immediately
1742 // after registration. See g_application_register().1766 // after registration. See g_application_register().
1743-func (x *Application) ConnectStartup(cb *func(Application)) uint32 {1767+func (x *Application) ConnectStartup(cb *func(Application)) uint {
1744 cbPtr := uintptr(unsafe.Pointer(cb))1768 cbPtr := uintptr(unsafe.Pointer(cb))
1745 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1769 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1746- return gobject.SignalConnect(x.GoPointer(), "startup", cbRefPtr)1770+ handlerID := gobject.SignalConnect(x.GoPointer(), "startup", cbRefPtr)
1771+ glib.SaveHandlerMapping(handlerID, cbPtr)
1772+ return handlerID
1747 }1773 }
1748 1774
1749 fcb := func(clsPtr uintptr) {1775 fcb := func(clsPtr uintptr) {
@@ -1756,7 +1782,9 @@ func (x *Application) ConnectStartup(cb *func(Application)) uint32 {
1756 }1782 }
1757 cbRefPtr := purego.NewCallback(fcb)1783 cbRefPtr := purego.NewCallback(fcb)
1758 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1784 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1759- return gobject.SignalConnect(x.GoPointer(), "startup", cbRefPtr)1785+ handlerID := gobject.SignalConnect(x.GoPointer(), "startup", cbRefPtr)
1786+ glib.SaveHandlerMapping(handlerID, cbPtr)
1787+ return handlerID
1760 }1788 }
1761 1789
1762 // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group.1790 // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group.
M v4/gio/gcancellable.go +11 -7
@@ -251,7 +251,7 @@ func (x *Cancellable) Cancel() {
251 251
252 }252 }
253 253
254-var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint32254+var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint
255 255
256 // Convenience function to connect to the #GCancellable::cancelled256 // Convenience function to connect to the #GCancellable::cancelled
257 // signal. Also handles the race condition that may happen257 // signal. Also handles the race condition that may happen
@@ -288,7 +288,7 @@ var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint32
288 // - [method@Gio.Cancellable.reset]288 // - [method@Gio.Cancellable.reset]
289 // - [method@Gio.Cancellable.make_pollfd]289 // - [method@Gio.Cancellable.make_pollfd]
290 // - [method@Gio.Cancellable.release_fd]290 // - [method@Gio.Cancellable.release_fd]
291-func (x *Cancellable) Connect(CallbackVar *gobject.Callback, DataVar uintptr, DataDestroyFuncVar *glib.DestroyNotify) uint32 {291+func (x *Cancellable) Connect(CallbackVar *gobject.Callback, DataVar uintptr, DataDestroyFuncVar *glib.DestroyNotify) uint {
292 292
293 var CallbackVarRef uintptr293 var CallbackVarRef uintptr
294 if CallbackVar != nil {294 if CallbackVar != nil {
@@ -325,7 +325,7 @@ func (x *Cancellable) Connect(CallbackVar *gobject.Callback, DataVar uintptr, Da
325 return cret325 return cret
326 }326 }
327 327
328-var xCancellableDisconnect func(uintptr, uint32)328+var xCancellableDisconnect func(uintptr, uint)
329 329
330 // Disconnects a handler from a cancellable instance similar to330 // Disconnects a handler from a cancellable instance similar to
331 // g_signal_handler_disconnect(). Additionally, in the event that a331 // g_signal_handler_disconnect(). Additionally, in the event that a
@@ -341,7 +341,7 @@ var xCancellableDisconnect func(uintptr, uint32)
341 //341 //
342 // If @cancellable is %NULL or @handler_id is `0` this function does342 // If @cancellable is %NULL or @handler_id is `0` this function does
343 // nothing.343 // nothing.
344-func (x *Cancellable) Disconnect(HandlerIdVar uint32) {344+func (x *Cancellable) Disconnect(HandlerIdVar uint) {
345 345
346 xCancellableDisconnect(x.GoPointer(), HandlerIdVar)346 xCancellableDisconnect(x.GoPointer(), HandlerIdVar)
347 347
@@ -581,10 +581,12 @@ func (c *Cancellable) SetGoPointer(ptr uintptr) {
581 // Note that the cancelled signal is emitted in the thread that581 // Note that the cancelled signal is emitted in the thread that
582 // the user cancelled from, which may be the main thread. So, the582 // the user cancelled from, which may be the main thread. So, the
583 // cancellable signal should not do something that can block.583 // cancellable signal should not do something that can block.
584-func (x *Cancellable) ConnectCancelled(cb *func(Cancellable)) uint32 {584+func (x *Cancellable) ConnectCancelled(cb *func(Cancellable)) uint {
585 cbPtr := uintptr(unsafe.Pointer(cb))585 cbPtr := uintptr(unsafe.Pointer(cb))
586 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {586 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
587- return gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)587+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)
588+ glib.SaveHandlerMapping(handlerID, cbPtr)
589+ return handlerID
588 }590 }
589 591
590 fcb := func(clsPtr uintptr) {592 fcb := func(clsPtr uintptr) {
@@ -597,7 +599,9 @@ func (x *Cancellable) ConnectCancelled(cb *func(Cancellable)) uint32 {
597 }599 }
598 cbRefPtr := purego.NewCallback(fcb)600 cbRefPtr := purego.NewCallback(fcb)
599 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)601 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
600- return gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)602+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)
603+ glib.SaveHandlerMapping(handlerID, cbPtr)
604+ return handlerID
601 }605 }
602 606
603 var xCancellableGetCurrent func() uintptr607 var xCancellableGetCurrent func() uintptr
M v4/gio/gdbusauthobserver.go +14 -6
@@ -144,10 +144,12 @@ func (c *DBusAuthObserver) SetGoPointer(ptr uintptr) {
144 }144 }
145 145
146 // Emitted to check if @mechanism is allowed to be used.146 // Emitted to check if @mechanism is allowed to be used.
147-func (x *DBusAuthObserver) ConnectAllowMechanism(cb *func(DBusAuthObserver, string) bool) uint32 {147+func (x *DBusAuthObserver) ConnectAllowMechanism(cb *func(DBusAuthObserver, string) bool) uint {
148 cbPtr := uintptr(unsafe.Pointer(cb))148 cbPtr := uintptr(unsafe.Pointer(cb))
149 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {149 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
150- return gobject.SignalConnect(x.GoPointer(), "allow-mechanism", cbRefPtr)150+ handlerID := gobject.SignalConnect(x.GoPointer(), "allow-mechanism", cbRefPtr)
151+ glib.SaveHandlerMapping(handlerID, cbPtr)
152+ return handlerID
151 }153 }
152 154
153 fcb := func(clsPtr uintptr, MechanismVarp string) bool {155 fcb := func(clsPtr uintptr, MechanismVarp string) bool {
@@ -160,15 +162,19 @@ func (x *DBusAuthObserver) ConnectAllowMechanism(cb *func(DBusAuthObserver, stri
160 }162 }
161 cbRefPtr := purego.NewCallback(fcb)163 cbRefPtr := purego.NewCallback(fcb)
162 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)164 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
163- return gobject.SignalConnect(x.GoPointer(), "allow-mechanism", cbRefPtr)165+ handlerID := gobject.SignalConnect(x.GoPointer(), "allow-mechanism", cbRefPtr)
166+ glib.SaveHandlerMapping(handlerID, cbPtr)
167+ return handlerID
164 }168 }
165 169
166 // Emitted to check if a peer that is successfully authenticated170 // Emitted to check if a peer that is successfully authenticated
167 // is authorized.171 // is authorized.
168-func (x *DBusAuthObserver) ConnectAuthorizeAuthenticatedPeer(cb *func(DBusAuthObserver, uintptr, uintptr) bool) uint32 {172+func (x *DBusAuthObserver) ConnectAuthorizeAuthenticatedPeer(cb *func(DBusAuthObserver, uintptr, uintptr) bool) uint {
169 cbPtr := uintptr(unsafe.Pointer(cb))173 cbPtr := uintptr(unsafe.Pointer(cb))
170 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {174 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
171- return gobject.SignalConnect(x.GoPointer(), "authorize-authenticated-peer", cbRefPtr)175+ handlerID := gobject.SignalConnect(x.GoPointer(), "authorize-authenticated-peer", cbRefPtr)
176+ glib.SaveHandlerMapping(handlerID, cbPtr)
177+ return handlerID
172 }178 }
173 179
174 fcb := func(clsPtr uintptr, StreamVarp uintptr, CredentialsVarp uintptr) bool {180 fcb := func(clsPtr uintptr, StreamVarp uintptr, CredentialsVarp uintptr) bool {
@@ -181,7 +187,9 @@ func (x *DBusAuthObserver) ConnectAuthorizeAuthenticatedPeer(cb *func(DBusAuthOb
181 }187 }
182 cbRefPtr := purego.NewCallback(fcb)188 cbRefPtr := purego.NewCallback(fcb)
183 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)189 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
184- return gobject.SignalConnect(x.GoPointer(), "authorize-authenticated-peer", cbRefPtr)190+ handlerID := gobject.SignalConnect(x.GoPointer(), "authorize-authenticated-peer", cbRefPtr)
191+ glib.SaveHandlerMapping(handlerID, cbPtr)
192+ return handlerID
185 }193 }
186 194
187 func init() {195 func init() {
M v4/gio/gdbusconnection.go +7 -3
@@ -1879,10 +1879,12 @@ func (x *DBusConnection) GetPropertyUniqueName() string {
1879 // Upon receiving this signal, you should give up your reference to1879 // Upon receiving this signal, you should give up your reference to
1880 // @connection. You are guaranteed that this signal is emitted only1880 // @connection. You are guaranteed that this signal is emitted only
1881 // once.1881 // once.
1882-func (x *DBusConnection) ConnectClosed(cb *func(DBusConnection, bool, uintptr)) uint32 {1882+func (x *DBusConnection) ConnectClosed(cb *func(DBusConnection, bool, uintptr)) uint {
1883 cbPtr := uintptr(unsafe.Pointer(cb))1883 cbPtr := uintptr(unsafe.Pointer(cb))
1884 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1884 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1885- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)1885+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
1886+ glib.SaveHandlerMapping(handlerID, cbPtr)
1887+ return handlerID
1886 }1888 }
1887 1889
1888 fcb := func(clsPtr uintptr, RemotePeerVanishedVarp bool, ErrorVarp uintptr) {1890 fcb := func(clsPtr uintptr, RemotePeerVanishedVarp bool, ErrorVarp uintptr) {
@@ -1895,7 +1897,9 @@ func (x *DBusConnection) ConnectClosed(cb *func(DBusConnection, bool, uintptr))
1895 }1897 }
1896 cbRefPtr := purego.NewCallback(fcb)1898 cbRefPtr := purego.NewCallback(fcb)
1897 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1899 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1898- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)1900+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
1901+ glib.SaveHandlerMapping(handlerID, cbPtr)
1902+ return handlerID
1899 }1903 }
1900 1904
1901 // Starts asynchronous initialization of the object implementing the1905 // Starts asynchronous initialization of the object implementing the
M v4/gio/gdbusinterfaceskeleton.go +7 -3
@@ -392,10 +392,12 @@ func (c *DBusInterfaceSkeleton) SetGoPointer(ptr uintptr) {
392 // flags set, no dedicated thread is ever used and the call will be392 // flags set, no dedicated thread is ever used and the call will be
393 // handled in the same thread as the object that @interface belongs393 // handled in the same thread as the object that @interface belongs
394 // to was exported in.394 // to was exported in.
395-func (x *DBusInterfaceSkeleton) ConnectGAuthorizeMethod(cb *func(DBusInterfaceSkeleton, uintptr) bool) uint32 {395+func (x *DBusInterfaceSkeleton) ConnectGAuthorizeMethod(cb *func(DBusInterfaceSkeleton, uintptr) bool) uint {
396 cbPtr := uintptr(unsafe.Pointer(cb))396 cbPtr := uintptr(unsafe.Pointer(cb))
397 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {397 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
398- return gobject.SignalConnect(x.GoPointer(), "g-authorize-method", cbRefPtr)398+ handlerID := gobject.SignalConnect(x.GoPointer(), "g-authorize-method", cbRefPtr)
399+ glib.SaveHandlerMapping(handlerID, cbPtr)
400+ return handlerID
399 }401 }
400 402
401 fcb := func(clsPtr uintptr, InvocationVarp uintptr) bool {403 fcb := func(clsPtr uintptr, InvocationVarp uintptr) bool {
@@ -408,7 +410,9 @@ func (x *DBusInterfaceSkeleton) ConnectGAuthorizeMethod(cb *func(DBusInterfaceSk
408 }410 }
409 cbRefPtr := purego.NewCallback(fcb)411 cbRefPtr := purego.NewCallback(fcb)
410 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)412 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
411- return gobject.SignalConnect(x.GoPointer(), "g-authorize-method", cbRefPtr)413+ handlerID := gobject.SignalConnect(x.GoPointer(), "g-authorize-method", cbRefPtr)
414+ glib.SaveHandlerMapping(handlerID, cbPtr)
415+ return handlerID
412 }416 }
413 417
414 // Gets the #GDBusObject that @interface_ belongs to, if any.418 // Gets the #GDBusObject that @interface_ belongs to, if any.
M v4/gio/gdbusobjectmanagerclient.go +14 -6
@@ -509,10 +509,12 @@ func (x *DBusObjectManagerClient) GetPropertyObjectPath() string {
509 // This signal is emitted in the thread-default main context509 // This signal is emitted in the thread-default main context
510 // (see [method@GLib.MainContext.push_thread_default])510 // (see [method@GLib.MainContext.push_thread_default])
511 // that @manager was constructed in.511 // that @manager was constructed in.
512-func (x *DBusObjectManagerClient) ConnectInterfaceProxyPropertiesChanged(cb *func(DBusObjectManagerClient, uintptr, uintptr, uintptr, []string)) uint32 {512+func (x *DBusObjectManagerClient) ConnectInterfaceProxyPropertiesChanged(cb *func(DBusObjectManagerClient, uintptr, uintptr, uintptr, []string)) uint {
513 cbPtr := uintptr(unsafe.Pointer(cb))513 cbPtr := uintptr(unsafe.Pointer(cb))
514 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {514 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
515- return gobject.SignalConnect(x.GoPointer(), "interface-proxy-properties-changed", cbRefPtr)515+ handlerID := gobject.SignalConnect(x.GoPointer(), "interface-proxy-properties-changed", cbRefPtr)
516+ glib.SaveHandlerMapping(handlerID, cbPtr)
517+ return handlerID
516 }518 }
517 519
518 fcb := func(clsPtr uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, ChangedPropertiesVarp uintptr, InvalidatedPropertiesVarp []string) {520 fcb := func(clsPtr uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, ChangedPropertiesVarp uintptr, InvalidatedPropertiesVarp []string) {
@@ -525,7 +527,9 @@ func (x *DBusObjectManagerClient) ConnectInterfaceProxyPropertiesChanged(cb *fun
525 }527 }
526 cbRefPtr := purego.NewCallback(fcb)528 cbRefPtr := purego.NewCallback(fcb)
527 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)529 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
528- return gobject.SignalConnect(x.GoPointer(), "interface-proxy-properties-changed", cbRefPtr)530+ handlerID := gobject.SignalConnect(x.GoPointer(), "interface-proxy-properties-changed", cbRefPtr)
531+ glib.SaveHandlerMapping(handlerID, cbPtr)
532+ return handlerID
529 }533 }
530 534
531 // Emitted when a D-Bus signal is received on @interface_proxy.535 // Emitted when a D-Bus signal is received on @interface_proxy.
@@ -536,10 +540,12 @@ func (x *DBusObjectManagerClient) ConnectInterfaceProxyPropertiesChanged(cb *fun
536 // This signal is emitted in the thread-default main context540 // This signal is emitted in the thread-default main context
537 // (see [method@GLib.MainContext.push_thread_default])541 // (see [method@GLib.MainContext.push_thread_default])
538 // that @manager was constructed in.542 // that @manager was constructed in.
539-func (x *DBusObjectManagerClient) ConnectInterfaceProxySignal(cb *func(DBusObjectManagerClient, uintptr, uintptr, string, string, uintptr)) uint32 {543+func (x *DBusObjectManagerClient) ConnectInterfaceProxySignal(cb *func(DBusObjectManagerClient, uintptr, uintptr, string, string, uintptr)) uint {
540 cbPtr := uintptr(unsafe.Pointer(cb))544 cbPtr := uintptr(unsafe.Pointer(cb))
541 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {545 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
542- return gobject.SignalConnect(x.GoPointer(), "interface-proxy-signal", cbRefPtr)546+ handlerID := gobject.SignalConnect(x.GoPointer(), "interface-proxy-signal", cbRefPtr)
547+ glib.SaveHandlerMapping(handlerID, cbPtr)
548+ return handlerID
543 }549 }
544 550
545 fcb := func(clsPtr uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) {551 fcb := func(clsPtr uintptr, ObjectProxyVarp uintptr, InterfaceProxyVarp uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) {
@@ -552,7 +558,9 @@ func (x *DBusObjectManagerClient) ConnectInterfaceProxySignal(cb *func(DBusObjec
552 }558 }
553 cbRefPtr := purego.NewCallback(fcb)559 cbRefPtr := purego.NewCallback(fcb)
554 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)560 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
555- return gobject.SignalConnect(x.GoPointer(), "interface-proxy-signal", cbRefPtr)561+ handlerID := gobject.SignalConnect(x.GoPointer(), "interface-proxy-signal", cbRefPtr)
562+ glib.SaveHandlerMapping(handlerID, cbPtr)
563+ return handlerID
556 }564 }
557 565
558 // Starts asynchronous initialization of the object implementing the566 // Starts asynchronous initialization of the object implementing the
M v4/gio/gdbusobjectskeleton.go +7 -3
@@ -189,10 +189,12 @@ func (x *DBusObjectSkeleton) GetPropertyGObjectPath() string {
189 // except that it is for the enclosing object.189 // except that it is for the enclosing object.
190 //190 //
191 // The default class handler just returns %TRUE.191 // The default class handler just returns %TRUE.
192-func (x *DBusObjectSkeleton) ConnectAuthorizeMethod(cb *func(DBusObjectSkeleton, uintptr, uintptr) bool) uint32 {192+func (x *DBusObjectSkeleton) ConnectAuthorizeMethod(cb *func(DBusObjectSkeleton, uintptr, uintptr) bool) uint {
193 cbPtr := uintptr(unsafe.Pointer(cb))193 cbPtr := uintptr(unsafe.Pointer(cb))
194 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {194 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
195- return gobject.SignalConnect(x.GoPointer(), "authorize-method", cbRefPtr)195+ handlerID := gobject.SignalConnect(x.GoPointer(), "authorize-method", cbRefPtr)
196+ glib.SaveHandlerMapping(handlerID, cbPtr)
197+ return handlerID
196 }198 }
197 199
198 fcb := func(clsPtr uintptr, InterfaceVarp uintptr, InvocationVarp uintptr) bool {200 fcb := func(clsPtr uintptr, InterfaceVarp uintptr, InvocationVarp uintptr) bool {
@@ -205,7 +207,9 @@ func (x *DBusObjectSkeleton) ConnectAuthorizeMethod(cb *func(DBusObjectSkeleton,
205 }207 }
206 cbRefPtr := purego.NewCallback(fcb)208 cbRefPtr := purego.NewCallback(fcb)
207 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)209 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
208- return gobject.SignalConnect(x.GoPointer(), "authorize-method", cbRefPtr)210+ handlerID := gobject.SignalConnect(x.GoPointer(), "authorize-method", cbRefPtr)
211+ glib.SaveHandlerMapping(handlerID, cbPtr)
212+ return handlerID
209 }213 }
210 214
211 // Gets the D-Bus interface with name @interface_name associated with215 // Gets the D-Bus interface with name @interface_name associated with
M v4/gio/gdbusproxy.go +21 -9
@@ -825,10 +825,12 @@ func (x *DBusProxy) GetPropertyGObjectPath() string {
825 // This signal corresponds to the825 // This signal corresponds to the
826 // `PropertiesChanged` D-Bus signal on the826 // `PropertiesChanged` D-Bus signal on the
827 // `org.freedesktop.DBus.Properties` interface.827 // `org.freedesktop.DBus.Properties` interface.
828-func (x *DBusProxy) ConnectGPropertiesChanged(cb *func(DBusProxy, uintptr, []string)) uint32 {828+func (x *DBusProxy) ConnectGPropertiesChanged(cb *func(DBusProxy, uintptr, []string)) uint {
829 cbPtr := uintptr(unsafe.Pointer(cb))829 cbPtr := uintptr(unsafe.Pointer(cb))
830 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {830 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
831- return gobject.SignalConnect(x.GoPointer(), "g-properties-changed", cbRefPtr)831+ handlerID := gobject.SignalConnect(x.GoPointer(), "g-properties-changed", cbRefPtr)
832+ glib.SaveHandlerMapping(handlerID, cbPtr)
833+ return handlerID
832 }834 }
833 835
834 fcb := func(clsPtr uintptr, ChangedPropertiesVarp uintptr, InvalidatedPropertiesVarp []string) {836 fcb := func(clsPtr uintptr, ChangedPropertiesVarp uintptr, InvalidatedPropertiesVarp []string) {
@@ -841,7 +843,9 @@ func (x *DBusProxy) ConnectGPropertiesChanged(cb *func(DBusProxy, uintptr, []str
841 }843 }
842 cbRefPtr := purego.NewCallback(fcb)844 cbRefPtr := purego.NewCallback(fcb)
843 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)845 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
844- return gobject.SignalConnect(x.GoPointer(), "g-properties-changed", cbRefPtr)846+ handlerID := gobject.SignalConnect(x.GoPointer(), "g-properties-changed", cbRefPtr)
847+ glib.SaveHandlerMapping(handlerID, cbPtr)
848+ return handlerID
845 }849 }
846 850
847 // Emitted when a signal from the remote object and interface that @proxy is for, has been received.851 // Emitted when a signal from the remote object and interface that @proxy is for, has been received.
@@ -849,10 +853,12 @@ func (x *DBusProxy) ConnectGPropertiesChanged(cb *func(DBusProxy, uintptr, []str
849 // Since 2.72 this signal supports detailed connections. You can connect to853 // Since 2.72 this signal supports detailed connections. You can connect to
850 // the detailed signal `g-signal::x` in order to receive callbacks only when854 // the detailed signal `g-signal::x` in order to receive callbacks only when
851 // signal `x` is received from the remote object.855 // signal `x` is received from the remote object.
852-func (x *DBusProxy) ConnectGSignal(cb *func(DBusProxy, string, string, uintptr)) uint32 {856+func (x *DBusProxy) ConnectGSignal(cb *func(DBusProxy, string, string, uintptr)) uint {
853 cbPtr := uintptr(unsafe.Pointer(cb))857 cbPtr := uintptr(unsafe.Pointer(cb))
854 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {858 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
855- return gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr)859+ handlerID := gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr)
860+ glib.SaveHandlerMapping(handlerID, cbPtr)
861+ return handlerID
856 }862 }
857 863
858 fcb := func(clsPtr uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) {864 fcb := func(clsPtr uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) {
@@ -865,16 +871,20 @@ func (x *DBusProxy) ConnectGSignal(cb *func(DBusProxy, string, string, uintptr))
865 }871 }
866 cbRefPtr := purego.NewCallback(fcb)872 cbRefPtr := purego.NewCallback(fcb)
867 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)873 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
868- return gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr)874+ handlerID := gobject.SignalConnect(x.GoPointer(), "g-signal", cbRefPtr)
875+ glib.SaveHandlerMapping(handlerID, cbPtr)
876+ return handlerID
869 }877 }
870 878
871 // ConnectGSignalWithDetail connects to the "g-signal" signal with a detail string.879 // ConnectGSignalWithDetail connects to the "g-signal" signal with a detail string.
872 // The detail is appended as "g-signal::<detail>".880 // The detail is appended as "g-signal::<detail>".
873-func (x *DBusProxy) ConnectGSignalWithDetail(detail string, cb *func(DBusProxy, string, string, uintptr)) uint32 {881+func (x *DBusProxy) ConnectGSignalWithDetail(detail string, cb *func(DBusProxy, string, string, uintptr)) uint {
874 cbPtr := uintptr(unsafe.Pointer(cb))882 cbPtr := uintptr(unsafe.Pointer(cb))
875 signalName := fmt.Sprintf("g-signal::%s", detail)883 signalName := fmt.Sprintf("g-signal::%s", detail)
876 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {884 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
877- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)885+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
886+ glib.SaveHandlerMapping(handlerID, cbPtr)
887+ return handlerID
878 }888 }
879 889
880 fcb := func(clsPtr uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) {890 fcb := func(clsPtr uintptr, SenderNameVarp string, SignalNameVarp string, ParametersVarp uintptr) {
@@ -887,7 +897,9 @@ func (x *DBusProxy) ConnectGSignalWithDetail(detail string, cb *func(DBusProxy,
887 }897 }
888 cbRefPtr := purego.NewCallback(fcb)898 cbRefPtr := purego.NewCallback(fcb)
889 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)899 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
890- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)900+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
901+ glib.SaveHandlerMapping(handlerID, cbPtr)
902+ return handlerID
891 }903 }
892 904
893 // Starts asynchronous initialization of the object implementing the905 // Starts asynchronous initialization of the object implementing the
M v4/gio/gdbusserver.go +7 -3
@@ -235,10 +235,12 @@ func (x *DBusServer) GetPropertyGuid() string {
235 // before incoming messages on @connection are processed. This means235 // before incoming messages on @connection are processed. This means
236 // that it's suitable to call g_dbus_connection_register_object() or236 // that it's suitable to call g_dbus_connection_register_object() or
237 // similar from the signal handler.237 // similar from the signal handler.
238-func (x *DBusServer) ConnectNewConnection(cb *func(DBusServer, uintptr) bool) uint32 {238+func (x *DBusServer) ConnectNewConnection(cb *func(DBusServer, uintptr) bool) uint {
239 cbPtr := uintptr(unsafe.Pointer(cb))239 cbPtr := uintptr(unsafe.Pointer(cb))
240 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {240 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
241- return gobject.SignalConnect(x.GoPointer(), "new-connection", cbRefPtr)241+ handlerID := gobject.SignalConnect(x.GoPointer(), "new-connection", cbRefPtr)
242+ glib.SaveHandlerMapping(handlerID, cbPtr)
243+ return handlerID
242 }244 }
243 245
244 fcb := func(clsPtr uintptr, ConnectionVarp uintptr) bool {246 fcb := func(clsPtr uintptr, ConnectionVarp uintptr) bool {
@@ -251,7 +253,9 @@ func (x *DBusServer) ConnectNewConnection(cb *func(DBusServer, uintptr) bool) ui
251 }253 }
252 cbRefPtr := purego.NewCallback(fcb)254 cbRefPtr := purego.NewCallback(fcb)
253 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)255 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
254- return gobject.SignalConnect(x.GoPointer(), "new-connection", cbRefPtr)256+ handlerID := gobject.SignalConnect(x.GoPointer(), "new-connection", cbRefPtr)
257+ glib.SaveHandlerMapping(handlerID, cbPtr)
258+ return handlerID
255 }259 }
256 260
257 // Initializes the object implementing the interface.261 // Initializes the object implementing the interface.
M v4/gio/gdebugcontrollerdbus.go +7 -3
@@ -263,10 +263,12 @@ func (c *DebugControllerDBus) SetGoPointer(ptr uintptr) {
263 // Signal handlers must not modify @invocation, or cause it to return a value.263 // Signal handlers must not modify @invocation, or cause it to return a value.
264 //264 //
265 // The default class handler just returns %TRUE.265 // The default class handler just returns %TRUE.
266-func (x *DebugControllerDBus) ConnectAuthorize(cb *func(DebugControllerDBus, uintptr) bool) uint32 {266+func (x *DebugControllerDBus) ConnectAuthorize(cb *func(DebugControllerDBus, uintptr) bool) uint {
267 cbPtr := uintptr(unsafe.Pointer(cb))267 cbPtr := uintptr(unsafe.Pointer(cb))
268 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {268 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
269- return gobject.SignalConnect(x.GoPointer(), "authorize", cbRefPtr)269+ handlerID := gobject.SignalConnect(x.GoPointer(), "authorize", cbRefPtr)
270+ glib.SaveHandlerMapping(handlerID, cbPtr)
271+ return handlerID
270 }272 }
271 273
272 fcb := func(clsPtr uintptr, InvocationVarp uintptr) bool {274 fcb := func(clsPtr uintptr, InvocationVarp uintptr) bool {
@@ -279,7 +281,9 @@ func (x *DebugControllerDBus) ConnectAuthorize(cb *func(DebugControllerDBus, uin
279 }281 }
280 cbRefPtr := purego.NewCallback(fcb)282 cbRefPtr := purego.NewCallback(fcb)
281 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)283 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
282- return gobject.SignalConnect(x.GoPointer(), "authorize", cbRefPtr)284+ handlerID := gobject.SignalConnect(x.GoPointer(), "authorize", cbRefPtr)
285+ glib.SaveHandlerMapping(handlerID, cbPtr)
286+ return handlerID
283 }287 }
284 288
285 // Get the value of #GDebugController:debug-enabled.289 // Get the value of #GDebugController:debug-enabled.
M v4/gio/gfilemonitor.go +7 -3
@@ -343,10 +343,12 @@ func (x *FileMonitor) GetPropertyRateLimit() int {
343 // old path, and @other_file will be set to a #GFile containing the new path.343 // old path, and @other_file will be set to a #GFile containing the new path.
344 //344 //
345 // In all the other cases, @other_file will be set to #NULL.345 // In all the other cases, @other_file will be set to #NULL.
346-func (x *FileMonitor) ConnectChanged(cb *func(FileMonitor, uintptr, uintptr, FileMonitorEvent)) uint32 {346+func (x *FileMonitor) ConnectChanged(cb *func(FileMonitor, uintptr, uintptr, FileMonitorEvent)) uint {
347 cbPtr := uintptr(unsafe.Pointer(cb))347 cbPtr := uintptr(unsafe.Pointer(cb))
348 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {348 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
349- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)349+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
350+ glib.SaveHandlerMapping(handlerID, cbPtr)
351+ return handlerID
350 }352 }
351 353
352 fcb := func(clsPtr uintptr, FileVarp uintptr, OtherFileVarp uintptr, EventTypeVarp FileMonitorEvent) {354 fcb := func(clsPtr uintptr, FileVarp uintptr, OtherFileVarp uintptr, EventTypeVarp FileMonitorEvent) {
@@ -359,7 +361,9 @@ func (x *FileMonitor) ConnectChanged(cb *func(FileMonitor, uintptr, uintptr, Fil
359 }361 }
360 cbRefPtr := purego.NewCallback(fcb)362 cbRefPtr := purego.NewCallback(fcb)
361 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)363 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
362- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)364+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
365+ glib.SaveHandlerMapping(handlerID, cbPtr)
366+ return handlerID
363 }367 }
364 368
365 func init() {369 func init() {
M v4/gio/gfilenamecompleter.go +7 -3
@@ -205,10 +205,12 @@ func (c *FilenameCompleter) SetGoPointer(ptr uintptr) {
205 }205 }
206 206
207 // Emitted when the file name completion information comes available.207 // Emitted when the file name completion information comes available.
208-func (x *FilenameCompleter) ConnectGotCompletionData(cb *func(FilenameCompleter)) uint32 {208+func (x *FilenameCompleter) ConnectGotCompletionData(cb *func(FilenameCompleter)) uint {
209 cbPtr := uintptr(unsafe.Pointer(cb))209 cbPtr := uintptr(unsafe.Pointer(cb))
210 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {210 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
211- return gobject.SignalConnect(x.GoPointer(), "got-completion-data", cbRefPtr)211+ handlerID := gobject.SignalConnect(x.GoPointer(), "got-completion-data", cbRefPtr)
212+ glib.SaveHandlerMapping(handlerID, cbPtr)
213+ return handlerID
212 }214 }
213 215
214 fcb := func(clsPtr uintptr) {216 fcb := func(clsPtr uintptr) {
@@ -221,7 +223,9 @@ func (x *FilenameCompleter) ConnectGotCompletionData(cb *func(FilenameCompleter)
221 }223 }
222 cbRefPtr := purego.NewCallback(fcb)224 cbRefPtr := purego.NewCallback(fcb)
223 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)225 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
224- return gobject.SignalConnect(x.GoPointer(), "got-completion-data", cbRefPtr)226+ handlerID := gobject.SignalConnect(x.GoPointer(), "got-completion-data", cbRefPtr)
227+ glib.SaveHandlerMapping(handlerID, cbPtr)
228+ return handlerID
225 }229 }
226 230
227 func init() {231 func init() {
M v4/gio/gmemoryoutputstream.go +7 -7
@@ -389,10 +389,10 @@ func (x *MemoryOutputStream) GetPropertyData() uintptr {
389 389
390 // GetPropertyDataSize gets the "data-size" property.390 // GetPropertyDataSize gets the "data-size" property.
391 // Size of data written to the buffer.391 // Size of data written to the buffer.
392-func (x *MemoryOutputStream) GetPropertyDataSize() uint32 {392+func (x *MemoryOutputStream) GetPropertyDataSize() uint {
393 var v gobject.Value393 var v gobject.Value
394 x.GetProperty("data-size", &v)394 x.GetProperty("data-size", &v)
395- return v.GetUlong()395+ return v.GetUint()
396 }396 }
397 397
398 // SetPropertyDestroyFunction sets the "destroy-function" property.398 // SetPropertyDestroyFunction sets the "destroy-function" property.
@@ -431,19 +431,19 @@ func (x *MemoryOutputStream) GetPropertyReallocFunction() uintptr {
431 431
432 // SetPropertySize sets the "size" property.432 // SetPropertySize sets the "size" property.
433 // Current size of the data buffer.433 // Current size of the data buffer.
434-func (x *MemoryOutputStream) SetPropertySize(value uint32) {434+func (x *MemoryOutputStream) SetPropertySize(value uint) {
435 var v gobject.Value435 var v gobject.Value
436- v.Init(gobject.TypeUlongVal)436+ v.Init(gobject.TypeUintVal)
437- v.SetUlong(value)437+ v.SetUint(value)
438 x.SetProperty("size", &v)438 x.SetProperty("size", &v)
439 }439 }
440 440
441 // GetPropertySize gets the "size" property.441 // GetPropertySize gets the "size" property.
442 // Current size of the data buffer.442 // Current size of the data buffer.
443-func (x *MemoryOutputStream) GetPropertySize() uint32 {443+func (x *MemoryOutputStream) GetPropertySize() uint {
444 var v gobject.Value444 var v gobject.Value
445 x.GetProperty("size", &v)445 x.GetProperty("size", &v)
446- return v.GetUlong()446+ return v.GetUint()
447 }447 }
448 448
449 // Checks if @stream is actually pollable. Some classes may implement449 // Checks if @stream is actually pollable. Some classes may implement
M v4/gio/gmenumodel.go +7 -3
@@ -896,10 +896,12 @@ func (c *MenuModel) SetGoPointer(ptr uintptr) {
896 // Signal handlers may query the model (particularly the added items)896 // Signal handlers may query the model (particularly the added items)
897 // and expect to see the results of the modification that is being897 // and expect to see the results of the modification that is being
898 // reported. The signal is emitted after the modification.898 // reported. The signal is emitted after the modification.
899-func (x *MenuModel) ConnectItemsChanged(cb *func(MenuModel, int, int, int)) uint32 {899+func (x *MenuModel) ConnectItemsChanged(cb *func(MenuModel, int, int, int)) uint {
900 cbPtr := uintptr(unsafe.Pointer(cb))900 cbPtr := uintptr(unsafe.Pointer(cb))
901 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {901 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
902- return gobject.SignalConnect(x.GoPointer(), "items-changed", cbRefPtr)902+ handlerID := gobject.SignalConnect(x.GoPointer(), "items-changed", cbRefPtr)
903+ glib.SaveHandlerMapping(handlerID, cbPtr)
904+ return handlerID
903 }905 }
904 906
905 fcb := func(clsPtr uintptr, PositionVarp int, RemovedVarp int, AddedVarp int) {907 fcb := func(clsPtr uintptr, PositionVarp int, RemovedVarp int, AddedVarp int) {
@@ -912,7 +914,9 @@ func (x *MenuModel) ConnectItemsChanged(cb *func(MenuModel, int, int, int)) uint
912 }914 }
913 cbRefPtr := purego.NewCallback(fcb)915 cbRefPtr := purego.NewCallback(fcb)
914 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)916 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
915- return gobject.SignalConnect(x.GoPointer(), "items-changed", cbRefPtr)917+ handlerID := gobject.SignalConnect(x.GoPointer(), "items-changed", cbRefPtr)
918+ glib.SaveHandlerMapping(handlerID, cbPtr)
919+ return handlerID
916 }920 }
917 921
918 func init() {922 func init() {
M v4/gio/gmountoperation.go +42 -18
@@ -825,10 +825,12 @@ func (x *MountOperation) GetPropertyUsername() string {
825 //825 //
826 // Implementations of GMountOperation should handle this signal826 // Implementations of GMountOperation should handle this signal
827 // by dismissing open password dialogs.827 // by dismissing open password dialogs.
828-func (x *MountOperation) ConnectAborted(cb *func(MountOperation)) uint32 {828+func (x *MountOperation) ConnectAborted(cb *func(MountOperation)) uint {
829 cbPtr := uintptr(unsafe.Pointer(cb))829 cbPtr := uintptr(unsafe.Pointer(cb))
830 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {830 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
831- return gobject.SignalConnect(x.GoPointer(), "aborted", cbRefPtr)831+ handlerID := gobject.SignalConnect(x.GoPointer(), "aborted", cbRefPtr)
832+ glib.SaveHandlerMapping(handlerID, cbPtr)
833+ return handlerID
832 }834 }
833 835
834 fcb := func(clsPtr uintptr) {836 fcb := func(clsPtr uintptr) {
@@ -841,7 +843,9 @@ func (x *MountOperation) ConnectAborted(cb *func(MountOperation)) uint32 {
841 }843 }
842 cbRefPtr := purego.NewCallback(fcb)844 cbRefPtr := purego.NewCallback(fcb)
843 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)845 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
844- return gobject.SignalConnect(x.GoPointer(), "aborted", cbRefPtr)846+ handlerID := gobject.SignalConnect(x.GoPointer(), "aborted", cbRefPtr)
847+ glib.SaveHandlerMapping(handlerID, cbPtr)
848+ return handlerID
845 }849 }
846 850
847 // Emitted when a mount operation asks the user for a password.851 // Emitted when a mount operation asks the user for a password.
@@ -849,10 +853,12 @@ func (x *MountOperation) ConnectAborted(cb *func(MountOperation)) uint32 {
849 // If the message contains a line break, the first line should be853 // If the message contains a line break, the first line should be
850 // presented as a heading. For example, it may be used as the854 // presented as a heading. For example, it may be used as the
851 // primary text in a #GtkMessageDialog.855 // primary text in a #GtkMessageDialog.
852-func (x *MountOperation) ConnectAskPassword(cb *func(MountOperation, string, string, string, AskPasswordFlags)) uint32 {856+func (x *MountOperation) ConnectAskPassword(cb *func(MountOperation, string, string, string, AskPasswordFlags)) uint {
853 cbPtr := uintptr(unsafe.Pointer(cb))857 cbPtr := uintptr(unsafe.Pointer(cb))
854 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {858 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
855- return gobject.SignalConnect(x.GoPointer(), "ask-password", cbRefPtr)859+ handlerID := gobject.SignalConnect(x.GoPointer(), "ask-password", cbRefPtr)
860+ glib.SaveHandlerMapping(handlerID, cbPtr)
861+ return handlerID
856 }862 }
857 863
858 fcb := func(clsPtr uintptr, MessageVarp string, DefaultUserVarp string, DefaultDomainVarp string, FlagsVarp AskPasswordFlags) {864 fcb := func(clsPtr uintptr, MessageVarp string, DefaultUserVarp string, DefaultDomainVarp string, FlagsVarp AskPasswordFlags) {
@@ -865,7 +871,9 @@ func (x *MountOperation) ConnectAskPassword(cb *func(MountOperation, string, str
865 }871 }
866 cbRefPtr := purego.NewCallback(fcb)872 cbRefPtr := purego.NewCallback(fcb)
867 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)873 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
868- return gobject.SignalConnect(x.GoPointer(), "ask-password", cbRefPtr)874+ handlerID := gobject.SignalConnect(x.GoPointer(), "ask-password", cbRefPtr)
875+ glib.SaveHandlerMapping(handlerID, cbPtr)
876+ return handlerID
869 }877 }
870 878
871 // Emitted when asking the user a question and gives a list of879 // Emitted when asking the user a question and gives a list of
@@ -874,10 +882,12 @@ func (x *MountOperation) ConnectAskPassword(cb *func(MountOperation, string, str
874 // If the message contains a line break, the first line should be882 // If the message contains a line break, the first line should be
875 // presented as a heading. For example, it may be used as the883 // presented as a heading. For example, it may be used as the
876 // primary text in a #GtkMessageDialog.884 // primary text in a #GtkMessageDialog.
877-func (x *MountOperation) ConnectAskQuestion(cb *func(MountOperation, string, []string)) uint32 {885+func (x *MountOperation) ConnectAskQuestion(cb *func(MountOperation, string, []string)) uint {
878 cbPtr := uintptr(unsafe.Pointer(cb))886 cbPtr := uintptr(unsafe.Pointer(cb))
879 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {887 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
880- return gobject.SignalConnect(x.GoPointer(), "ask-question", cbRefPtr)888+ handlerID := gobject.SignalConnect(x.GoPointer(), "ask-question", cbRefPtr)
889+ glib.SaveHandlerMapping(handlerID, cbPtr)
890+ return handlerID
881 }891 }
882 892
883 fcb := func(clsPtr uintptr, MessageVarp string, ChoicesVarp []string) {893 fcb := func(clsPtr uintptr, MessageVarp string, ChoicesVarp []string) {
@@ -890,14 +900,18 @@ func (x *MountOperation) ConnectAskQuestion(cb *func(MountOperation, string, []s
890 }900 }
891 cbRefPtr := purego.NewCallback(fcb)901 cbRefPtr := purego.NewCallback(fcb)
892 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)902 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
893- return gobject.SignalConnect(x.GoPointer(), "ask-question", cbRefPtr)903+ handlerID := gobject.SignalConnect(x.GoPointer(), "ask-question", cbRefPtr)
904+ glib.SaveHandlerMapping(handlerID, cbPtr)
905+ return handlerID
894 }906 }
895 907
896 // Emitted when the user has replied to the mount operation.908 // Emitted when the user has replied to the mount operation.
897-func (x *MountOperation) ConnectReply(cb *func(MountOperation, MountOperationResult)) uint32 {909+func (x *MountOperation) ConnectReply(cb *func(MountOperation, MountOperationResult)) uint {
898 cbPtr := uintptr(unsafe.Pointer(cb))910 cbPtr := uintptr(unsafe.Pointer(cb))
899 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {911 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
900- return gobject.SignalConnect(x.GoPointer(), "reply", cbRefPtr)912+ handlerID := gobject.SignalConnect(x.GoPointer(), "reply", cbRefPtr)
913+ glib.SaveHandlerMapping(handlerID, cbPtr)
914+ return handlerID
901 }915 }
902 916
903 fcb := func(clsPtr uintptr, ResultVarp MountOperationResult) {917 fcb := func(clsPtr uintptr, ResultVarp MountOperationResult) {
@@ -910,7 +924,9 @@ func (x *MountOperation) ConnectReply(cb *func(MountOperation, MountOperationRes
910 }924 }
911 cbRefPtr := purego.NewCallback(fcb)925 cbRefPtr := purego.NewCallback(fcb)
912 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)926 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
913- return gobject.SignalConnect(x.GoPointer(), "reply", cbRefPtr)927+ handlerID := gobject.SignalConnect(x.GoPointer(), "reply", cbRefPtr)
928+ glib.SaveHandlerMapping(handlerID, cbPtr)
929+ return handlerID
914 }930 }
915 931
916 // Emitted when one or more processes are blocking an operation932 // Emitted when one or more processes are blocking an operation
@@ -925,10 +941,12 @@ func (x *MountOperation) ConnectReply(cb *func(MountOperation, MountOperationRes
925 // If the message contains a line break, the first line should be941 // If the message contains a line break, the first line should be
926 // presented as a heading. For example, it may be used as the942 // presented as a heading. For example, it may be used as the
927 // primary text in a #GtkMessageDialog.943 // primary text in a #GtkMessageDialog.
928-func (x *MountOperation) ConnectShowProcesses(cb *func(MountOperation, string, []glib.Pid, []string)) uint32 {944+func (x *MountOperation) ConnectShowProcesses(cb *func(MountOperation, string, []glib.Pid, []string)) uint {
929 cbPtr := uintptr(unsafe.Pointer(cb))945 cbPtr := uintptr(unsafe.Pointer(cb))
930 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {946 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
931- return gobject.SignalConnect(x.GoPointer(), "show-processes", cbRefPtr)947+ handlerID := gobject.SignalConnect(x.GoPointer(), "show-processes", cbRefPtr)
948+ glib.SaveHandlerMapping(handlerID, cbPtr)
949+ return handlerID
932 }950 }
933 951
934 fcb := func(clsPtr uintptr, MessageVarp string, ProcessesVarp []glib.Pid, ChoicesVarp []string) {952 fcb := func(clsPtr uintptr, MessageVarp string, ProcessesVarp []glib.Pid, ChoicesVarp []string) {
@@ -941,7 +959,9 @@ func (x *MountOperation) ConnectShowProcesses(cb *func(MountOperation, string, [
941 }959 }
942 cbRefPtr := purego.NewCallback(fcb)960 cbRefPtr := purego.NewCallback(fcb)
943 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)961 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
944- return gobject.SignalConnect(x.GoPointer(), "show-processes", cbRefPtr)962+ handlerID := gobject.SignalConnect(x.GoPointer(), "show-processes", cbRefPtr)
963+ glib.SaveHandlerMapping(handlerID, cbPtr)
964+ return handlerID
945 }965 }
946 966
947 // Emitted when an unmount operation has been busy for more than some time967 // Emitted when an unmount operation has been busy for more than some time
@@ -960,10 +980,12 @@ func (x *MountOperation) ConnectShowProcesses(cb *func(MountOperation, string, [
960 // If the message contains a line break, the first line should be980 // If the message contains a line break, the first line should be
961 // presented as a heading. For example, it may be used as the981 // presented as a heading. For example, it may be used as the
962 // primary text in a #GtkMessageDialog.982 // primary text in a #GtkMessageDialog.
963-func (x *MountOperation) ConnectShowUnmountProgress(cb *func(MountOperation, string, int64, int64)) uint32 {983+func (x *MountOperation) ConnectShowUnmountProgress(cb *func(MountOperation, string, int64, int64)) uint {
964 cbPtr := uintptr(unsafe.Pointer(cb))984 cbPtr := uintptr(unsafe.Pointer(cb))
965 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {985 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
966- return gobject.SignalConnect(x.GoPointer(), "show-unmount-progress", cbRefPtr)986+ handlerID := gobject.SignalConnect(x.GoPointer(), "show-unmount-progress", cbRefPtr)
987+ glib.SaveHandlerMapping(handlerID, cbPtr)
988+ return handlerID
967 }989 }
968 990
969 fcb := func(clsPtr uintptr, MessageVarp string, TimeLeftVarp int64, BytesLeftVarp int64) {991 fcb := func(clsPtr uintptr, MessageVarp string, TimeLeftVarp int64, BytesLeftVarp int64) {
@@ -976,7 +998,9 @@ func (x *MountOperation) ConnectShowUnmountProgress(cb *func(MountOperation, str
976 }998 }
977 cbRefPtr := purego.NewCallback(fcb)999 cbRefPtr := purego.NewCallback(fcb)
978 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1000 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
979- return gobject.SignalConnect(x.GoPointer(), "show-unmount-progress", cbRefPtr)1001+ handlerID := gobject.SignalConnect(x.GoPointer(), "show-unmount-progress", cbRefPtr)
1002+ glib.SaveHandlerMapping(handlerID, cbPtr)
1003+ return handlerID
980 }1004 }
981 1005
982 func init() {1006 func init() {
M v4/gio/gresolver.go +7 -3
@@ -951,10 +951,12 @@ func (x *Resolver) GetPropertyTimeout() uint {
951 951
952 // Emitted when the resolver notices that the system resolver952 // Emitted when the resolver notices that the system resolver
953 // configuration has changed.953 // configuration has changed.
954-func (x *Resolver) ConnectReload(cb *func(Resolver)) uint32 {954+func (x *Resolver) ConnectReload(cb *func(Resolver)) uint {
955 cbPtr := uintptr(unsafe.Pointer(cb))955 cbPtr := uintptr(unsafe.Pointer(cb))
956 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {956 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
957- return gobject.SignalConnect(x.GoPointer(), "reload", cbRefPtr)957+ handlerID := gobject.SignalConnect(x.GoPointer(), "reload", cbRefPtr)
958+ glib.SaveHandlerMapping(handlerID, cbPtr)
959+ return handlerID
958 }960 }
959 961
960 fcb := func(clsPtr uintptr) {962 fcb := func(clsPtr uintptr) {
@@ -967,7 +969,9 @@ func (x *Resolver) ConnectReload(cb *func(Resolver)) uint32 {
967 }969 }
968 cbRefPtr := purego.NewCallback(fcb)970 cbRefPtr := purego.NewCallback(fcb)
969 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)971 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
970- return gobject.SignalConnect(x.GoPointer(), "reload", cbRefPtr)972+ handlerID := gobject.SignalConnect(x.GoPointer(), "reload", cbRefPtr)
973+ glib.SaveHandlerMapping(handlerID, cbPtr)
974+ return handlerID
971 }975 }
972 976
973 var xResolverFreeAddresses func(*glib.List)977 var xResolverFreeAddresses func(*glib.List)
M v4/gio/gsettings.go +42 -18
@@ -1701,10 +1701,12 @@ func (x *Settings) GetPropertySettingsSchema() uintptr {
1701 // The default handler for this signal invokes the [signal@Gio.Settings::changed] signal1701 // The default handler for this signal invokes the [signal@Gio.Settings::changed] signal
1702 // for each affected key. If any other connected handler returns1702 // for each affected key. If any other connected handler returns
1703 // true then this default functionality will be suppressed.1703 // true then this default functionality will be suppressed.
1704-func (x *Settings) ConnectChangeEvent(cb *func(Settings, uintptr, int) bool) uint32 {1704+func (x *Settings) ConnectChangeEvent(cb *func(Settings, uintptr, int) bool) uint {
1705 cbPtr := uintptr(unsafe.Pointer(cb))1705 cbPtr := uintptr(unsafe.Pointer(cb))
1706 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1706 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1707- return gobject.SignalConnect(x.GoPointer(), "change-event", cbRefPtr)1707+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-event", cbRefPtr)
1708+ glib.SaveHandlerMapping(handlerID, cbPtr)
1709+ return handlerID
1708 }1710 }
1709 1711
1710 fcb := func(clsPtr uintptr, KeysVarp uintptr, NKeysVarp int) bool {1712 fcb := func(clsPtr uintptr, KeysVarp uintptr, NKeysVarp int) bool {
@@ -1717,7 +1719,9 @@ func (x *Settings) ConnectChangeEvent(cb *func(Settings, uintptr, int) bool) uin
1717 }1719 }
1718 cbRefPtr := purego.NewCallback(fcb)1720 cbRefPtr := purego.NewCallback(fcb)
1719 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1721 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1720- return gobject.SignalConnect(x.GoPointer(), "change-event", cbRefPtr)1722+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-event", cbRefPtr)
1723+ glib.SaveHandlerMapping(handlerID, cbPtr)
1724+ return handlerID
1721 }1725 }
1722 1726
1723 // Emitted when a key has potentially changed.1727 // Emitted when a key has potentially changed.
@@ -1731,10 +1735,12 @@ func (x *Settings) ConnectChangeEvent(cb *func(Settings, uintptr, int) bool) uin
1731 //1735 //
1732 // Note that @settings only emits this signal if you have read @key at1736 // Note that @settings only emits this signal if you have read @key at
1733 // least once while a signal handler was already connected for @key.1737 // least once while a signal handler was already connected for @key.
1734-func (x *Settings) ConnectChanged(cb *func(Settings, string)) uint32 {1738+func (x *Settings) ConnectChanged(cb *func(Settings, string)) uint {
1735 cbPtr := uintptr(unsafe.Pointer(cb))1739 cbPtr := uintptr(unsafe.Pointer(cb))
1736 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1740 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1737- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)1741+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1742+ glib.SaveHandlerMapping(handlerID, cbPtr)
1743+ return handlerID
1738 }1744 }
1739 1745
1740 fcb := func(clsPtr uintptr, KeyVarp string) {1746 fcb := func(clsPtr uintptr, KeyVarp string) {
@@ -1747,16 +1753,20 @@ func (x *Settings) ConnectChanged(cb *func(Settings, string)) uint32 {
1747 }1753 }
1748 cbRefPtr := purego.NewCallback(fcb)1754 cbRefPtr := purego.NewCallback(fcb)
1749 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1755 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1750- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)1756+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1757+ glib.SaveHandlerMapping(handlerID, cbPtr)
1758+ return handlerID
1751 }1759 }
1752 1760
1753 // ConnectChangedWithDetail connects to the "changed" signal with a detail string.1761 // ConnectChangedWithDetail connects to the "changed" signal with a detail string.
1754 // The detail is appended as "changed::<detail>".1762 // The detail is appended as "changed::<detail>".
1755-func (x *Settings) ConnectChangedWithDetail(detail string, cb *func(Settings, string)) uint32 {1763+func (x *Settings) ConnectChangedWithDetail(detail string, cb *func(Settings, string)) uint {
1756 cbPtr := uintptr(unsafe.Pointer(cb))1764 cbPtr := uintptr(unsafe.Pointer(cb))
1757 signalName := fmt.Sprintf("changed::%s", detail)1765 signalName := fmt.Sprintf("changed::%s", detail)
1758 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1766 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1759- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)1767+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
1768+ glib.SaveHandlerMapping(handlerID, cbPtr)
1769+ return handlerID
1760 }1770 }
1761 1771
1762 fcb := func(clsPtr uintptr, KeyVarp string) {1772 fcb := func(clsPtr uintptr, KeyVarp string) {
@@ -1769,7 +1779,9 @@ func (x *Settings) ConnectChangedWithDetail(detail string, cb *func(Settings, st
1769 }1779 }
1770 cbRefPtr := purego.NewCallback(fcb)1780 cbRefPtr := purego.NewCallback(fcb)
1771 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1781 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1772- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)1782+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
1783+ glib.SaveHandlerMapping(handlerID, cbPtr)
1784+ return handlerID
1773 }1785 }
1774 1786
1775 // Emitted once per writability change event that affects this settings object.1787 // Emitted once per writability change event that affects this settings object.
@@ -1791,10 +1803,12 @@ func (x *Settings) ConnectChangedWithDetail(detail string, cb *func(Settings, st
1791 // example, a new mandatory setting is introduced). If any other1803 // example, a new mandatory setting is introduced). If any other
1792 // connected handler returns true then this default functionality1804 // connected handler returns true then this default functionality
1793 // will be suppressed.1805 // will be suppressed.
1794-func (x *Settings) ConnectWritableChangeEvent(cb *func(Settings, uint) bool) uint32 {1806+func (x *Settings) ConnectWritableChangeEvent(cb *func(Settings, uint) bool) uint {
1795 cbPtr := uintptr(unsafe.Pointer(cb))1807 cbPtr := uintptr(unsafe.Pointer(cb))
1796 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1808 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1797- return gobject.SignalConnect(x.GoPointer(), "writable-change-event", cbRefPtr)1809+ handlerID := gobject.SignalConnect(x.GoPointer(), "writable-change-event", cbRefPtr)
1810+ glib.SaveHandlerMapping(handlerID, cbPtr)
1811+ return handlerID
1798 }1812 }
1799 1813
1800 fcb := func(clsPtr uintptr, KeyVarp uint) bool {1814 fcb := func(clsPtr uintptr, KeyVarp uint) bool {
@@ -1807,7 +1821,9 @@ func (x *Settings) ConnectWritableChangeEvent(cb *func(Settings, uint) bool) uin
1807 }1821 }
1808 cbRefPtr := purego.NewCallback(fcb)1822 cbRefPtr := purego.NewCallback(fcb)
1809 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1823 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1810- return gobject.SignalConnect(x.GoPointer(), "writable-change-event", cbRefPtr)1824+ handlerID := gobject.SignalConnect(x.GoPointer(), "writable-change-event", cbRefPtr)
1825+ glib.SaveHandlerMapping(handlerID, cbPtr)
1826+ return handlerID
1811 }1827 }
1812 1828
1813 // Emitted when the writability of a key has potentially changed.1829 // Emitted when the writability of a key has potentially changed.
@@ -1818,10 +1834,12 @@ func (x *Settings) ConnectWritableChangeEvent(cb *func(Settings, uint) bool) uin
1818 // This signal supports detailed connections. You can connect to the1834 // This signal supports detailed connections. You can connect to the
1819 // detailed signal `writable-changed::x` in order to only receive1835 // detailed signal `writable-changed::x` in order to only receive
1820 // callbacks when the writability of `x` changes.1836 // callbacks when the writability of `x` changes.
1821-func (x *Settings) ConnectWritableChanged(cb *func(Settings, string)) uint32 {1837+func (x *Settings) ConnectWritableChanged(cb *func(Settings, string)) uint {
1822 cbPtr := uintptr(unsafe.Pointer(cb))1838 cbPtr := uintptr(unsafe.Pointer(cb))
1823 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1839 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1824- return gobject.SignalConnect(x.GoPointer(), "writable-changed", cbRefPtr)1840+ handlerID := gobject.SignalConnect(x.GoPointer(), "writable-changed", cbRefPtr)
1841+ glib.SaveHandlerMapping(handlerID, cbPtr)
1842+ return handlerID
1825 }1843 }
1826 1844
1827 fcb := func(clsPtr uintptr, KeyVarp string) {1845 fcb := func(clsPtr uintptr, KeyVarp string) {
@@ -1834,16 +1852,20 @@ func (x *Settings) ConnectWritableChanged(cb *func(Settings, string)) uint32 {
1834 }1852 }
1835 cbRefPtr := purego.NewCallback(fcb)1853 cbRefPtr := purego.NewCallback(fcb)
1836 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1854 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1837- return gobject.SignalConnect(x.GoPointer(), "writable-changed", cbRefPtr)1855+ handlerID := gobject.SignalConnect(x.GoPointer(), "writable-changed", cbRefPtr)
1856+ glib.SaveHandlerMapping(handlerID, cbPtr)
1857+ return handlerID
1838 }1858 }
1839 1859
1840 // ConnectWritableChangedWithDetail connects to the "writable-changed" signal with a detail string.1860 // ConnectWritableChangedWithDetail connects to the "writable-changed" signal with a detail string.
1841 // The detail is appended as "writable-changed::<detail>".1861 // The detail is appended as "writable-changed::<detail>".
1842-func (x *Settings) ConnectWritableChangedWithDetail(detail string, cb *func(Settings, string)) uint32 {1862+func (x *Settings) ConnectWritableChangedWithDetail(detail string, cb *func(Settings, string)) uint {
1843 cbPtr := uintptr(unsafe.Pointer(cb))1863 cbPtr := uintptr(unsafe.Pointer(cb))
1844 signalName := fmt.Sprintf("writable-changed::%s", detail)1864 signalName := fmt.Sprintf("writable-changed::%s", detail)
1845 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1865 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1846- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)1866+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
1867+ glib.SaveHandlerMapping(handlerID, cbPtr)
1868+ return handlerID
1847 }1869 }
1848 1870
1849 fcb := func(clsPtr uintptr, KeyVarp string) {1871 fcb := func(clsPtr uintptr, KeyVarp string) {
@@ -1856,7 +1878,9 @@ func (x *Settings) ConnectWritableChangedWithDetail(detail string, cb *func(Sett
1856 }1878 }
1857 cbRefPtr := purego.NewCallback(fcb)1879 cbRefPtr := purego.NewCallback(fcb)
1858 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1880 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1859- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)1881+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
1882+ glib.SaveHandlerMapping(handlerID, cbPtr)
1883+ return handlerID
1860 }1884 }
1861 1885
1862 var xSettingsListRelocatableSchemas func() []string1886 var xSettingsListRelocatableSchemas func() []string
M v4/gio/gsimpleaction.go +14 -6
@@ -226,10 +226,12 @@ func (x *SimpleAction) GetPropertyStateType() uintptr {
226 // type, the default is to forward them directly to226 // type, the default is to forward them directly to
227 // #GSimpleAction::change-state. This should allow almost all users227 // #GSimpleAction::change-state. This should allow almost all users
228 // of #GSimpleAction to connect only one handler or the other.228 // of #GSimpleAction to connect only one handler or the other.
229-func (x *SimpleAction) ConnectActivate(cb *func(SimpleAction, uintptr)) uint32 {229+func (x *SimpleAction) ConnectActivate(cb *func(SimpleAction, uintptr)) uint {
230 cbPtr := uintptr(unsafe.Pointer(cb))230 cbPtr := uintptr(unsafe.Pointer(cb))
231 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {231 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
232- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)232+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
233+ glib.SaveHandlerMapping(handlerID, cbPtr)
234+ return handlerID
233 }235 }
234 236
235 fcb := func(clsPtr uintptr, ParameterVarp uintptr) {237 fcb := func(clsPtr uintptr, ParameterVarp uintptr) {
@@ -242,7 +244,9 @@ func (x *SimpleAction) ConnectActivate(cb *func(SimpleAction, uintptr)) uint32 {
242 }244 }
243 cbRefPtr := purego.NewCallback(fcb)245 cbRefPtr := purego.NewCallback(fcb)
244 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)246 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
245- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)247+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
248+ glib.SaveHandlerMapping(handlerID, cbPtr)
249+ return handlerID
246 }250 }
247 251
248 // Indicates that the action just received a request to change its252 // Indicates that the action just received a request to change its
@@ -281,10 +285,12 @@ func (x *SimpleAction) ConnectActivate(cb *func(SimpleAction, uintptr)) uint32 {
281 //285 //
282 // The handler need not set the state to the requested value.286 // The handler need not set the state to the requested value.
283 // It could set it to any value at all, or take some other action.287 // It could set it to any value at all, or take some other action.
284-func (x *SimpleAction) ConnectChangeState(cb *func(SimpleAction, uintptr)) uint32 {288+func (x *SimpleAction) ConnectChangeState(cb *func(SimpleAction, uintptr)) uint {
285 cbPtr := uintptr(unsafe.Pointer(cb))289 cbPtr := uintptr(unsafe.Pointer(cb))
286 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {290 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
287- return gobject.SignalConnect(x.GoPointer(), "change-state", cbRefPtr)291+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-state", cbRefPtr)
292+ glib.SaveHandlerMapping(handlerID, cbPtr)
293+ return handlerID
288 }294 }
289 295
290 fcb := func(clsPtr uintptr, ValueVarp uintptr) {296 fcb := func(clsPtr uintptr, ValueVarp uintptr) {
@@ -297,7 +303,9 @@ func (x *SimpleAction) ConnectChangeState(cb *func(SimpleAction, uintptr)) uint3
297 }303 }
298 cbRefPtr := purego.NewCallback(fcb)304 cbRefPtr := purego.NewCallback(fcb)
299 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)305 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
300- return gobject.SignalConnect(x.GoPointer(), "change-state", cbRefPtr)306+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-state", cbRefPtr)
307+ glib.SaveHandlerMapping(handlerID, cbPtr)
308+ return handlerID
301 }309 }
302 310
303 // Activates the action.311 // Activates the action.
M v4/gio/gsocketclient.go +7 -3
@@ -967,10 +967,12 @@ func (x *SocketClient) GetPropertyTls() bool {
967 //967 //
968 // Note that there may be additional #GSocketClientEvent values in968 // Note that there may be additional #GSocketClientEvent values in
969 // the future; unrecognized @event values should be ignored.969 // the future; unrecognized @event values should be ignored.
970-func (x *SocketClient) ConnectEvent(cb *func(SocketClient, SocketClientEvent, uintptr, uintptr)) uint32 {970+func (x *SocketClient) ConnectEvent(cb *func(SocketClient, SocketClientEvent, uintptr, uintptr)) uint {
971 cbPtr := uintptr(unsafe.Pointer(cb))971 cbPtr := uintptr(unsafe.Pointer(cb))
972 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {972 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
973- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)973+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
974+ glib.SaveHandlerMapping(handlerID, cbPtr)
975+ return handlerID
974 }976 }
975 977
976 fcb := func(clsPtr uintptr, EventVarp SocketClientEvent, ConnectableVarp uintptr, ConnectionVarp uintptr) {978 fcb := func(clsPtr uintptr, EventVarp SocketClientEvent, ConnectableVarp uintptr, ConnectionVarp uintptr) {
@@ -983,7 +985,9 @@ func (x *SocketClient) ConnectEvent(cb *func(SocketClient, SocketClientEvent, ui
983 }985 }
984 cbRefPtr := purego.NewCallback(fcb)986 cbRefPtr := purego.NewCallback(fcb)
985 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)987 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
986- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)988+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
989+ glib.SaveHandlerMapping(handlerID, cbPtr)
990+ return handlerID
987 }991 }
988 992
989 func init() {993 func init() {
M v4/gio/gsocketlistener.go +7 -3
@@ -607,10 +607,12 @@ func (x *SocketListener) GetPropertyListenBacklog() int {
607 // Note that when @listener is used to listen on both IPv4 and607 // Note that when @listener is used to listen on both IPv4 and
608 // IPv6, a separate set of signals will be emitted for each, and608 // IPv6, a separate set of signals will be emitted for each, and
609 // the order they happen in is undefined.609 // the order they happen in is undefined.
610-func (x *SocketListener) ConnectEvent(cb *func(SocketListener, SocketListenerEvent, uintptr)) uint32 {610+func (x *SocketListener) ConnectEvent(cb *func(SocketListener, SocketListenerEvent, uintptr)) uint {
611 cbPtr := uintptr(unsafe.Pointer(cb))611 cbPtr := uintptr(unsafe.Pointer(cb))
612 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {612 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
613- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)613+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
614+ glib.SaveHandlerMapping(handlerID, cbPtr)
615+ return handlerID
614 }616 }
615 617
616 fcb := func(clsPtr uintptr, EventVarp SocketListenerEvent, SocketVarp uintptr) {618 fcb := func(clsPtr uintptr, EventVarp SocketListenerEvent, SocketVarp uintptr) {
@@ -623,7 +625,9 @@ func (x *SocketListener) ConnectEvent(cb *func(SocketListener, SocketListenerEve
623 }625 }
624 cbRefPtr := purego.NewCallback(fcb)626 cbRefPtr := purego.NewCallback(fcb)
625 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)627 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
626- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)628+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
629+ glib.SaveHandlerMapping(handlerID, cbPtr)
630+ return handlerID
627 }631 }
628 632
629 func init() {633 func init() {
M v4/gio/gsocketservice.go +7 -3
@@ -358,10 +358,12 @@ func (x *SocketService) GetPropertyActive() bool {
358 //358 //
359 // @connection will be unreffed once the signal handler returns,359 // @connection will be unreffed once the signal handler returns,
360 // so you need to ref it yourself if you are planning to use it.360 // so you need to ref it yourself if you are planning to use it.
361-func (x *SocketService) ConnectIncoming(cb *func(SocketService, uintptr, uintptr) bool) uint32 {361+func (x *SocketService) ConnectIncoming(cb *func(SocketService, uintptr, uintptr) bool) uint {
362 cbPtr := uintptr(unsafe.Pointer(cb))362 cbPtr := uintptr(unsafe.Pointer(cb))
363 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {363 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
364- return gobject.SignalConnect(x.GoPointer(), "incoming", cbRefPtr)364+ handlerID := gobject.SignalConnect(x.GoPointer(), "incoming", cbRefPtr)
365+ glib.SaveHandlerMapping(handlerID, cbPtr)
366+ return handlerID
365 }367 }
366 368
367 fcb := func(clsPtr uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool {369 fcb := func(clsPtr uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool {
@@ -374,7 +376,9 @@ func (x *SocketService) ConnectIncoming(cb *func(SocketService, uintptr, uintptr
374 }376 }
375 cbRefPtr := purego.NewCallback(fcb)377 cbRefPtr := purego.NewCallback(fcb)
376 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)378 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
377- return gobject.SignalConnect(x.GoPointer(), "incoming", cbRefPtr)379+ handlerID := gobject.SignalConnect(x.GoPointer(), "incoming", cbRefPtr)
380+ glib.SaveHandlerMapping(handlerID, cbPtr)
381+ return handlerID
378 }382 }
379 383
380 func init() {384 func init() {
M v4/gio/gthreadedsocketservice.go +7 -3
@@ -261,10 +261,12 @@ func (x *ThreadedSocketService) GetPropertyMaxThreads() int {
261 // incoming connection. This thread is dedicated to handling261 // incoming connection. This thread is dedicated to handling
262 // @connection and may perform blocking IO. The signal handler need262 // @connection and may perform blocking IO. The signal handler need
263 // not return until the connection is closed.263 // not return until the connection is closed.
264-func (x *ThreadedSocketService) ConnectRun(cb *func(ThreadedSocketService, uintptr, uintptr) bool) uint32 {264+func (x *ThreadedSocketService) ConnectRun(cb *func(ThreadedSocketService, uintptr, uintptr) bool) uint {
265 cbPtr := uintptr(unsafe.Pointer(cb))265 cbPtr := uintptr(unsafe.Pointer(cb))
266 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {266 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
267- return gobject.SignalConnect(x.GoPointer(), "run", cbRefPtr)267+ handlerID := gobject.SignalConnect(x.GoPointer(), "run", cbRefPtr)
268+ glib.SaveHandlerMapping(handlerID, cbPtr)
269+ return handlerID
268 }270 }
269 271
270 fcb := func(clsPtr uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool {272 fcb := func(clsPtr uintptr, ConnectionVarp uintptr, SourceObjectVarp uintptr) bool {
@@ -277,7 +279,9 @@ func (x *ThreadedSocketService) ConnectRun(cb *func(ThreadedSocketService, uintp
277 }279 }
278 cbRefPtr := purego.NewCallback(fcb)280 cbRefPtr := purego.NewCallback(fcb)
279 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)281 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
280- return gobject.SignalConnect(x.GoPointer(), "run", cbRefPtr)282+ handlerID := gobject.SignalConnect(x.GoPointer(), "run", cbRefPtr)
283+ glib.SaveHandlerMapping(handlerID, cbPtr)
284+ return handlerID
281 }285 }
282 286
283 func init() {287 func init() {
M v4/gio/gtlscertificate.go +28 -4
@@ -462,7 +462,13 @@ func (x *TlsCertificate) GetPropertyCertificate() []byte {
462 if ptr == 0 {462 if ptr == 0 {
463 return nil463 return nil
464 }464 }
465- return unsafe.Slice((*byte)(unsafe.Pointer(ptr)), 0)[:0]465+ // GByteArray layout: { guint8 *data; guint len; }
466+ dataPtr := *(*uintptr)(unsafe.Pointer(ptr))
467+ length := *(*uint32)(unsafe.Pointer(ptr + unsafe.Sizeof(uintptr(0))))
468+ if length == 0 || dataPtr == 0 {
469+ return nil
470+ }
471+ return unsafe.Slice((*byte)(unsafe.Pointer(dataPtr)), length)
466 }472 }
467 473
468 // SetPropertyCertificatePem sets the "certificate-pem" property.474 // SetPropertyCertificatePem sets the "certificate-pem" property.
@@ -496,7 +502,13 @@ func (x *TlsCertificate) GetPropertyDnsNames() []uintptr {
496 if ptr == 0 {502 if ptr == 0 {
497 return nil503 return nil
498 }504 }
499- return unsafe.Slice((*uintptr)(unsafe.Pointer(ptr)), 0)[:0]505+ // GPtrArray layout: { gpointer *pdata; guint len; }
506+ dataPtr := *(*uintptr)(unsafe.Pointer(ptr))
507+ length := *(*uint32)(unsafe.Pointer(ptr + unsafe.Sizeof(uintptr(0))))
508+ if length == 0 || dataPtr == 0 {
509+ return nil
510+ }
511+ return unsafe.Slice((*uintptr)(unsafe.Pointer(dataPtr)), length)
500 }512 }
501 513
502 // GetPropertyIpAddresses gets the "ip-addresses" property.514 // GetPropertyIpAddresses gets the "ip-addresses" property.
@@ -509,7 +521,13 @@ func (x *TlsCertificate) GetPropertyIpAddresses() []uintptr {
509 if ptr == 0 {521 if ptr == 0 {
510 return nil522 return nil
511 }523 }
512- return unsafe.Slice((*uintptr)(unsafe.Pointer(ptr)), 0)[:0]524+ // GPtrArray layout: { gpointer *pdata; guint len; }
525+ dataPtr := *(*uintptr)(unsafe.Pointer(ptr))
526+ length := *(*uint32)(unsafe.Pointer(ptr + unsafe.Sizeof(uintptr(0))))
527+ if length == 0 || dataPtr == 0 {
528+ return nil
529+ }
530+ return unsafe.Slice((*uintptr)(unsafe.Pointer(dataPtr)), length)
513 }531 }
514 532
515 // GetPropertyIssuerName gets the "issuer-name" property.533 // GetPropertyIssuerName gets the "issuer-name" property.
@@ -634,7 +652,13 @@ func (x *TlsCertificate) GetPropertyPrivateKey() []byte {
634 if ptr == 0 {652 if ptr == 0 {
635 return nil653 return nil
636 }654 }
637- return unsafe.Slice((*byte)(unsafe.Pointer(ptr)), 0)[:0]655+ // GByteArray layout: { guint8 *data; guint len; }
656+ dataPtr := *(*uintptr)(unsafe.Pointer(ptr))
657+ length := *(*uint32)(unsafe.Pointer(ptr + unsafe.Sizeof(uintptr(0))))
658+ if length == 0 || dataPtr == 0 {
659+ return nil
660+ }
661+ return unsafe.Slice((*byte)(unsafe.Pointer(dataPtr)), length)
638 }662 }
639 663
640 // SetPropertyPrivateKeyPem sets the "private-key-pem" property.664 // SetPropertyPrivateKeyPem sets the "private-key-pem" property.
M v4/gio/gtlsconnection.go +7 -3
@@ -800,10 +800,12 @@ func (x *TlsConnection) GetPropertyUseSystemCertdb() bool {
800 // If you are doing I/O in another thread, you do not800 // If you are doing I/O in another thread, you do not
801 // need to worry about this, and can simply block in the signal801 // need to worry about this, and can simply block in the signal
802 // handler until the UI thread returns an answer.802 // handler until the UI thread returns an answer.
803-func (x *TlsConnection) ConnectAcceptCertificate(cb *func(TlsConnection, uintptr, TlsCertificateFlags) bool) uint32 {803+func (x *TlsConnection) ConnectAcceptCertificate(cb *func(TlsConnection, uintptr, TlsCertificateFlags) bool) uint {
804 cbPtr := uintptr(unsafe.Pointer(cb))804 cbPtr := uintptr(unsafe.Pointer(cb))
805 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {805 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
806- return gobject.SignalConnect(x.GoPointer(), "accept-certificate", cbRefPtr)806+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept-certificate", cbRefPtr)
807+ glib.SaveHandlerMapping(handlerID, cbPtr)
808+ return handlerID
807 }809 }
808 810
809 fcb := func(clsPtr uintptr, PeerCertVarp uintptr, ErrorsVarp TlsCertificateFlags) bool {811 fcb := func(clsPtr uintptr, PeerCertVarp uintptr, ErrorsVarp TlsCertificateFlags) bool {
@@ -816,7 +818,9 @@ func (x *TlsConnection) ConnectAcceptCertificate(cb *func(TlsConnection, uintptr
816 }818 }
817 cbRefPtr := purego.NewCallback(fcb)819 cbRefPtr := purego.NewCallback(fcb)
818 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)820 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
819- return gobject.SignalConnect(x.GoPointer(), "accept-certificate", cbRefPtr)821+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept-certificate", cbRefPtr)
822+ glib.SaveHandlerMapping(handlerID, cbPtr)
823+ return handlerID
820 }824 }
821 825
822 func init() {826 func init() {
M v4/gio/gunixsocketaddress.go +7 -1
@@ -257,7 +257,13 @@ func (x *UnixSocketAddress) GetPropertyPathAsArray() []byte {
257 if ptr == 0 {257 if ptr == 0 {
258 return nil258 return nil
259 }259 }
260- return unsafe.Slice((*byte)(unsafe.Pointer(ptr)), 0)[:0]260+ // GByteArray layout: { guint8 *data; guint len; }
261+ dataPtr := *(*uintptr)(unsafe.Pointer(ptr))
262+ length := *(*uint32)(unsafe.Pointer(ptr + unsafe.Sizeof(uintptr(0))))
263+ if length == 0 || dataPtr == 0 {
264+ return nil
265+ }
266+ return unsafe.Slice((*byte)(unsafe.Pointer(dataPtr)), length)
261 }267 }
262 268
263 // Creates a #GSocketAddressEnumerator for @connectable.269 // Creates a #GSocketAddressEnumerator for @connectable.
M v4/gio/gvolumemonitor.go +84 -36
@@ -793,10 +793,12 @@ func (c *VolumeMonitor) SetGoPointer(ptr uintptr) {
793 }793 }
794 794
795 // Emitted when a drive changes.795 // Emitted when a drive changes.
796-func (x *VolumeMonitor) ConnectDriveChanged(cb *func(VolumeMonitor, uintptr)) uint32 {796+func (x *VolumeMonitor) ConnectDriveChanged(cb *func(VolumeMonitor, uintptr)) uint {
797 cbPtr := uintptr(unsafe.Pointer(cb))797 cbPtr := uintptr(unsafe.Pointer(cb))
798 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {798 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
799- return gobject.SignalConnect(x.GoPointer(), "drive-changed", cbRefPtr)799+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-changed", cbRefPtr)
800+ glib.SaveHandlerMapping(handlerID, cbPtr)
801+ return handlerID
800 }802 }
801 803
802 fcb := func(clsPtr uintptr, DriveVarp uintptr) {804 fcb := func(clsPtr uintptr, DriveVarp uintptr) {
@@ -809,14 +811,18 @@ func (x *VolumeMonitor) ConnectDriveChanged(cb *func(VolumeMonitor, uintptr)) ui
809 }811 }
810 cbRefPtr := purego.NewCallback(fcb)812 cbRefPtr := purego.NewCallback(fcb)
811 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)813 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
812- return gobject.SignalConnect(x.GoPointer(), "drive-changed", cbRefPtr)814+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-changed", cbRefPtr)
815+ glib.SaveHandlerMapping(handlerID, cbPtr)
816+ return handlerID
813 }817 }
814 818
815 // Emitted when a drive is connected to the system.819 // Emitted when a drive is connected to the system.
816-func (x *VolumeMonitor) ConnectDriveConnected(cb *func(VolumeMonitor, uintptr)) uint32 {820+func (x *VolumeMonitor) ConnectDriveConnected(cb *func(VolumeMonitor, uintptr)) uint {
817 cbPtr := uintptr(unsafe.Pointer(cb))821 cbPtr := uintptr(unsafe.Pointer(cb))
818 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {822 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
819- return gobject.SignalConnect(x.GoPointer(), "drive-connected", cbRefPtr)823+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-connected", cbRefPtr)
824+ glib.SaveHandlerMapping(handlerID, cbPtr)
825+ return handlerID
820 }826 }
821 827
822 fcb := func(clsPtr uintptr, DriveVarp uintptr) {828 fcb := func(clsPtr uintptr, DriveVarp uintptr) {
@@ -829,14 +835,18 @@ func (x *VolumeMonitor) ConnectDriveConnected(cb *func(VolumeMonitor, uintptr))
829 }835 }
830 cbRefPtr := purego.NewCallback(fcb)836 cbRefPtr := purego.NewCallback(fcb)
831 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)837 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
832- return gobject.SignalConnect(x.GoPointer(), "drive-connected", cbRefPtr)838+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-connected", cbRefPtr)
839+ glib.SaveHandlerMapping(handlerID, cbPtr)
840+ return handlerID
833 }841 }
834 842
835 // Emitted when a drive is disconnected from the system.843 // Emitted when a drive is disconnected from the system.
836-func (x *VolumeMonitor) ConnectDriveDisconnected(cb *func(VolumeMonitor, uintptr)) uint32 {844+func (x *VolumeMonitor) ConnectDriveDisconnected(cb *func(VolumeMonitor, uintptr)) uint {
837 cbPtr := uintptr(unsafe.Pointer(cb))845 cbPtr := uintptr(unsafe.Pointer(cb))
838 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {846 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
839- return gobject.SignalConnect(x.GoPointer(), "drive-disconnected", cbRefPtr)847+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-disconnected", cbRefPtr)
848+ glib.SaveHandlerMapping(handlerID, cbPtr)
849+ return handlerID
840 }850 }
841 851
842 fcb := func(clsPtr uintptr, DriveVarp uintptr) {852 fcb := func(clsPtr uintptr, DriveVarp uintptr) {
@@ -849,14 +859,18 @@ func (x *VolumeMonitor) ConnectDriveDisconnected(cb *func(VolumeMonitor, uintptr
849 }859 }
850 cbRefPtr := purego.NewCallback(fcb)860 cbRefPtr := purego.NewCallback(fcb)
851 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)861 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
852- return gobject.SignalConnect(x.GoPointer(), "drive-disconnected", cbRefPtr)862+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-disconnected", cbRefPtr)
863+ glib.SaveHandlerMapping(handlerID, cbPtr)
864+ return handlerID
853 }865 }
854 866
855 // Emitted when the eject button is pressed on @drive.867 // Emitted when the eject button is pressed on @drive.
856-func (x *VolumeMonitor) ConnectDriveEjectButton(cb *func(VolumeMonitor, uintptr)) uint32 {868+func (x *VolumeMonitor) ConnectDriveEjectButton(cb *func(VolumeMonitor, uintptr)) uint {
857 cbPtr := uintptr(unsafe.Pointer(cb))869 cbPtr := uintptr(unsafe.Pointer(cb))
858 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {870 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
859- return gobject.SignalConnect(x.GoPointer(), "drive-eject-button", cbRefPtr)871+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-eject-button", cbRefPtr)
872+ glib.SaveHandlerMapping(handlerID, cbPtr)
873+ return handlerID
860 }874 }
861 875
862 fcb := func(clsPtr uintptr, DriveVarp uintptr) {876 fcb := func(clsPtr uintptr, DriveVarp uintptr) {
@@ -869,14 +883,18 @@ func (x *VolumeMonitor) ConnectDriveEjectButton(cb *func(VolumeMonitor, uintptr)
869 }883 }
870 cbRefPtr := purego.NewCallback(fcb)884 cbRefPtr := purego.NewCallback(fcb)
871 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)885 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
872- return gobject.SignalConnect(x.GoPointer(), "drive-eject-button", cbRefPtr)886+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-eject-button", cbRefPtr)
887+ glib.SaveHandlerMapping(handlerID, cbPtr)
888+ return handlerID
873 }889 }
874 890
875 // Emitted when the stop button is pressed on @drive.891 // Emitted when the stop button is pressed on @drive.
876-func (x *VolumeMonitor) ConnectDriveStopButton(cb *func(VolumeMonitor, uintptr)) uint32 {892+func (x *VolumeMonitor) ConnectDriveStopButton(cb *func(VolumeMonitor, uintptr)) uint {
877 cbPtr := uintptr(unsafe.Pointer(cb))893 cbPtr := uintptr(unsafe.Pointer(cb))
878 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {894 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
879- return gobject.SignalConnect(x.GoPointer(), "drive-stop-button", cbRefPtr)895+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-stop-button", cbRefPtr)
896+ glib.SaveHandlerMapping(handlerID, cbPtr)
897+ return handlerID
880 }898 }
881 899
882 fcb := func(clsPtr uintptr, DriveVarp uintptr) {900 fcb := func(clsPtr uintptr, DriveVarp uintptr) {
@@ -889,14 +907,18 @@ func (x *VolumeMonitor) ConnectDriveStopButton(cb *func(VolumeMonitor, uintptr))
889 }907 }
890 cbRefPtr := purego.NewCallback(fcb)908 cbRefPtr := purego.NewCallback(fcb)
891 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)909 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
892- return gobject.SignalConnect(x.GoPointer(), "drive-stop-button", cbRefPtr)910+ handlerID := gobject.SignalConnect(x.GoPointer(), "drive-stop-button", cbRefPtr)
911+ glib.SaveHandlerMapping(handlerID, cbPtr)
912+ return handlerID
893 }913 }
894 914
895 // Emitted when a mount is added.915 // Emitted when a mount is added.
896-func (x *VolumeMonitor) ConnectMountAdded(cb *func(VolumeMonitor, uintptr)) uint32 {916+func (x *VolumeMonitor) ConnectMountAdded(cb *func(VolumeMonitor, uintptr)) uint {
897 cbPtr := uintptr(unsafe.Pointer(cb))917 cbPtr := uintptr(unsafe.Pointer(cb))
898 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {918 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
899- return gobject.SignalConnect(x.GoPointer(), "mount-added", cbRefPtr)919+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-added", cbRefPtr)
920+ glib.SaveHandlerMapping(handlerID, cbPtr)
921+ return handlerID
900 }922 }
901 923
902 fcb := func(clsPtr uintptr, MountVarp uintptr) {924 fcb := func(clsPtr uintptr, MountVarp uintptr) {
@@ -909,14 +931,18 @@ func (x *VolumeMonitor) ConnectMountAdded(cb *func(VolumeMonitor, uintptr)) uint
909 }931 }
910 cbRefPtr := purego.NewCallback(fcb)932 cbRefPtr := purego.NewCallback(fcb)
911 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)933 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
912- return gobject.SignalConnect(x.GoPointer(), "mount-added", cbRefPtr)934+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-added", cbRefPtr)
935+ glib.SaveHandlerMapping(handlerID, cbPtr)
936+ return handlerID
913 }937 }
914 938
915 // Emitted when a mount changes.939 // Emitted when a mount changes.
916-func (x *VolumeMonitor) ConnectMountChanged(cb *func(VolumeMonitor, uintptr)) uint32 {940+func (x *VolumeMonitor) ConnectMountChanged(cb *func(VolumeMonitor, uintptr)) uint {
917 cbPtr := uintptr(unsafe.Pointer(cb))941 cbPtr := uintptr(unsafe.Pointer(cb))
918 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {942 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
919- return gobject.SignalConnect(x.GoPointer(), "mount-changed", cbRefPtr)943+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-changed", cbRefPtr)
944+ glib.SaveHandlerMapping(handlerID, cbPtr)
945+ return handlerID
920 }946 }
921 947
922 fcb := func(clsPtr uintptr, MountVarp uintptr) {948 fcb := func(clsPtr uintptr, MountVarp uintptr) {
@@ -929,17 +955,21 @@ func (x *VolumeMonitor) ConnectMountChanged(cb *func(VolumeMonitor, uintptr)) ui
929 }955 }
930 cbRefPtr := purego.NewCallback(fcb)956 cbRefPtr := purego.NewCallback(fcb)
931 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)957 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
932- return gobject.SignalConnect(x.GoPointer(), "mount-changed", cbRefPtr)958+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-changed", cbRefPtr)
959+ glib.SaveHandlerMapping(handlerID, cbPtr)
960+ return handlerID
933 }961 }
934 962
935 // May be emitted when a mount is about to be removed.963 // May be emitted when a mount is about to be removed.
936 //964 //
937 // This signal depends on the backend and is only emitted if965 // This signal depends on the backend and is only emitted if
938 // GIO was used to unmount.966 // GIO was used to unmount.
939-func (x *VolumeMonitor) ConnectMountPreUnmount(cb *func(VolumeMonitor, uintptr)) uint32 {967+func (x *VolumeMonitor) ConnectMountPreUnmount(cb *func(VolumeMonitor, uintptr)) uint {
940 cbPtr := uintptr(unsafe.Pointer(cb))968 cbPtr := uintptr(unsafe.Pointer(cb))
941 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {969 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
942- return gobject.SignalConnect(x.GoPointer(), "mount-pre-unmount", cbRefPtr)970+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-pre-unmount", cbRefPtr)
971+ glib.SaveHandlerMapping(handlerID, cbPtr)
972+ return handlerID
943 }973 }
944 974
945 fcb := func(clsPtr uintptr, MountVarp uintptr) {975 fcb := func(clsPtr uintptr, MountVarp uintptr) {
@@ -952,14 +982,18 @@ func (x *VolumeMonitor) ConnectMountPreUnmount(cb *func(VolumeMonitor, uintptr))
952 }982 }
953 cbRefPtr := purego.NewCallback(fcb)983 cbRefPtr := purego.NewCallback(fcb)
954 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)984 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
955- return gobject.SignalConnect(x.GoPointer(), "mount-pre-unmount", cbRefPtr)985+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-pre-unmount", cbRefPtr)
986+ glib.SaveHandlerMapping(handlerID, cbPtr)
987+ return handlerID
956 }988 }
957 989
958 // Emitted when a mount is removed.990 // Emitted when a mount is removed.
959-func (x *VolumeMonitor) ConnectMountRemoved(cb *func(VolumeMonitor, uintptr)) uint32 {991+func (x *VolumeMonitor) ConnectMountRemoved(cb *func(VolumeMonitor, uintptr)) uint {
960 cbPtr := uintptr(unsafe.Pointer(cb))992 cbPtr := uintptr(unsafe.Pointer(cb))
961 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {993 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
962- return gobject.SignalConnect(x.GoPointer(), "mount-removed", cbRefPtr)994+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-removed", cbRefPtr)
995+ glib.SaveHandlerMapping(handlerID, cbPtr)
996+ return handlerID
963 }997 }
964 998
965 fcb := func(clsPtr uintptr, MountVarp uintptr) {999 fcb := func(clsPtr uintptr, MountVarp uintptr) {
@@ -972,14 +1006,18 @@ func (x *VolumeMonitor) ConnectMountRemoved(cb *func(VolumeMonitor, uintptr)) ui
972 }1006 }
973 cbRefPtr := purego.NewCallback(fcb)1007 cbRefPtr := purego.NewCallback(fcb)
974 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1008 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
975- return gobject.SignalConnect(x.GoPointer(), "mount-removed", cbRefPtr)1009+ handlerID := gobject.SignalConnect(x.GoPointer(), "mount-removed", cbRefPtr)
1010+ glib.SaveHandlerMapping(handlerID, cbPtr)
1011+ return handlerID
976 }1012 }
977 1013
978 // Emitted when a mountable volume is added to the system.1014 // Emitted when a mountable volume is added to the system.
979-func (x *VolumeMonitor) ConnectVolumeAdded(cb *func(VolumeMonitor, uintptr)) uint32 {1015+func (x *VolumeMonitor) ConnectVolumeAdded(cb *func(VolumeMonitor, uintptr)) uint {
980 cbPtr := uintptr(unsafe.Pointer(cb))1016 cbPtr := uintptr(unsafe.Pointer(cb))
981 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1017 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
982- return gobject.SignalConnect(x.GoPointer(), "volume-added", cbRefPtr)1018+ handlerID := gobject.SignalConnect(x.GoPointer(), "volume-added", cbRefPtr)
1019+ glib.SaveHandlerMapping(handlerID, cbPtr)
1020+ return handlerID
983 }1021 }
984 1022
985 fcb := func(clsPtr uintptr, VolumeVarp uintptr) {1023 fcb := func(clsPtr uintptr, VolumeVarp uintptr) {
@@ -992,14 +1030,18 @@ func (x *VolumeMonitor) ConnectVolumeAdded(cb *func(VolumeMonitor, uintptr)) uin
992 }1030 }
993 cbRefPtr := purego.NewCallback(fcb)1031 cbRefPtr := purego.NewCallback(fcb)
994 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1032 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
995- return gobject.SignalConnect(x.GoPointer(), "volume-added", cbRefPtr)1033+ handlerID := gobject.SignalConnect(x.GoPointer(), "volume-added", cbRefPtr)
1034+ glib.SaveHandlerMapping(handlerID, cbPtr)
1035+ return handlerID
996 }1036 }
997 1037
998 // Emitted when mountable volume is changed.1038 // Emitted when mountable volume is changed.
999-func (x *VolumeMonitor) ConnectVolumeChanged(cb *func(VolumeMonitor, uintptr)) uint32 {1039+func (x *VolumeMonitor) ConnectVolumeChanged(cb *func(VolumeMonitor, uintptr)) uint {
1000 cbPtr := uintptr(unsafe.Pointer(cb))1040 cbPtr := uintptr(unsafe.Pointer(cb))
1001 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1041 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1002- return gobject.SignalConnect(x.GoPointer(), "volume-changed", cbRefPtr)1042+ handlerID := gobject.SignalConnect(x.GoPointer(), "volume-changed", cbRefPtr)
1043+ glib.SaveHandlerMapping(handlerID, cbPtr)
1044+ return handlerID
1003 }1045 }
1004 1046
1005 fcb := func(clsPtr uintptr, VolumeVarp uintptr) {1047 fcb := func(clsPtr uintptr, VolumeVarp uintptr) {
@@ -1012,14 +1054,18 @@ func (x *VolumeMonitor) ConnectVolumeChanged(cb *func(VolumeMonitor, uintptr)) u
1012 }1054 }
1013 cbRefPtr := purego.NewCallback(fcb)1055 cbRefPtr := purego.NewCallback(fcb)
1014 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1056 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1015- return gobject.SignalConnect(x.GoPointer(), "volume-changed", cbRefPtr)1057+ handlerID := gobject.SignalConnect(x.GoPointer(), "volume-changed", cbRefPtr)
1058+ glib.SaveHandlerMapping(handlerID, cbPtr)
1059+ return handlerID
1016 }1060 }
1017 1061
1018 // Emitted when a mountable volume is removed from the system.1062 // Emitted when a mountable volume is removed from the system.
1019-func (x *VolumeMonitor) ConnectVolumeRemoved(cb *func(VolumeMonitor, uintptr)) uint32 {1063+func (x *VolumeMonitor) ConnectVolumeRemoved(cb *func(VolumeMonitor, uintptr)) uint {
1020 cbPtr := uintptr(unsafe.Pointer(cb))1064 cbPtr := uintptr(unsafe.Pointer(cb))
1021 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1065 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1022- return gobject.SignalConnect(x.GoPointer(), "volume-removed", cbRefPtr)1066+ handlerID := gobject.SignalConnect(x.GoPointer(), "volume-removed", cbRefPtr)
1067+ glib.SaveHandlerMapping(handlerID, cbPtr)
1068+ return handlerID
1023 }1069 }
1024 1070
1025 fcb := func(clsPtr uintptr, VolumeVarp uintptr) {1071 fcb := func(clsPtr uintptr, VolumeVarp uintptr) {
@@ -1032,7 +1078,9 @@ func (x *VolumeMonitor) ConnectVolumeRemoved(cb *func(VolumeMonitor, uintptr)) u
1032 }1078 }
1033 cbRefPtr := purego.NewCallback(fcb)1079 cbRefPtr := purego.NewCallback(fcb)
1034 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1080 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1035- return gobject.SignalConnect(x.GoPointer(), "volume-removed", cbRefPtr)1081+ handlerID := gobject.SignalConnect(x.GoPointer(), "volume-removed", cbRefPtr)
1082+ glib.SaveHandlerMapping(handlerID, cbPtr)
1083+ return handlerID
1036 }1084 }
1037 1085
1038 var xVolumeMonitorAdoptOrphanMount func(uintptr) uintptr1086 var xVolumeMonitorAdoptOrphanMount func(uintptr) uintptr
M v4/glib/ggettext.go +2 -2
@@ -70,7 +70,7 @@ func Dgettext(DomainVar *string, MsgidVar string) string {
70 return cret70 return cret
71 }71 }
72 72
73-var xDngettext func(uintptr, string, string, uint32) string73+var xDngettext func(uintptr, string, string, uint) string
74 74
75 // This function is a wrapper of dngettext() which does not translate75 // This function is a wrapper of dngettext() which does not translate
76 // the message if the default domain as set with textdomain() has no76 // the message if the default domain as set with textdomain() has no
@@ -78,7 +78,7 @@ var xDngettext func(uintptr, string, string, uint32) string
78 //78 //
79 // See g_dgettext() for details of how this differs from dngettext()79 // See g_dgettext() for details of how this differs from dngettext()
80 // proper.80 // proper.
81-func Dngettext(DomainVar *string, MsgidVar string, MsgidPluralVar string, NVar uint32) string {81+func Dngettext(DomainVar *string, MsgidVar string, MsgidPluralVar string, NVar uint) string {
82 82
83 DomainVarPtr, DomainVarBytes := core.NullableStringToPtr(DomainVar)83 DomainVarPtr, DomainVarBytes := core.NullableStringToPtr(DomainVar)
84 84
M v4/glib/ghook.go +4 -4
@@ -46,7 +46,7 @@ type Hook struct {
46 46
47 RefCount uint47 RefCount uint
48 48
49- HookId uint3249+ HookId uint
50 50
51 Flags uint51 Flags uint
52 52
@@ -74,7 +74,7 @@ func (x *Hook) CompareIds(SiblingVar *Hook) int {
74 type HookList struct {74 type HookList struct {
75 _ structs.HostLayout75 _ structs.HostLayout
76 76
77- SeqId uint3277+ SeqId uint
78 78
79 HookSize uint79 HookSize uint
80 80
@@ -202,10 +202,10 @@ const (
202 GHookFlagMaskValue HookFlagMask = 15202 GHookFlagMaskValue HookFlagMask = 15
203 )203 )
204 204
205-var xHookDestroy func(*HookList, uint32) bool205+var xHookDestroy func(*HookList, uint) bool
206 206
207 // Destroys a #GHook, given its ID.207 // Destroys a #GHook, given its ID.
208-func HookDestroy(HookListVar *HookList, HookIdVar uint32) bool {208+func HookDestroy(HookListVar *HookList, HookIdVar uint) bool {
209 209
210 cret := xHookDestroy(HookListVar, HookIdVar)210 cret := xHookDestroy(HookListVar, HookIdVar)
211 211
M v4/glib/gstring.go +1 -5
@@ -80,11 +80,7 @@ var xNewStringTake func(uintptr) *String
80 // allocated and will eventually be freed with g_free().80 // allocated and will eventually be freed with g_free().
81 func NewStringTake(InitVar *string) *String {81 func NewStringTake(InitVar *string) *String {
82 82
83- InitVarPtr, InitVarBytes := core.NullableStringToPtr(InitVar)83+ cret := xNewStringTake(core.GStrdupNullable(InitVar))
84-
85- cret := xNewStringTake(InitVarPtr)
86-
87- runtime.KeepAlive(InitVarBytes)
88 84
89 return cret85 return cret
90 }86 }
M v4/glib/gstrvbuilder.go +2 -2
@@ -106,7 +106,7 @@ func (x *StrvBuilder) Ref() *StrvBuilder {
106 return cret106 return cret
107 }107 }
108 108
109-var xStrvBuilderTake func(uintptr, string)109+var xStrvBuilderTake func(uintptr, uintptr)
110 110
111 // Add a string to the end of the array. After @value belongs to the111 // Add a string to the end of the array. After @value belongs to the
112 // #GStrvBuilder and may no longer be modified by the caller.112 // #GStrvBuilder and may no longer be modified by the caller.
@@ -114,7 +114,7 @@ var xStrvBuilderTake func(uintptr, string)
114 // Since 2.80114 // Since 2.80
115 func (x *StrvBuilder) Take(ValueVar string) {115 func (x *StrvBuilder) Take(ValueVar string) {
116 116
117- xStrvBuilderTake(x.GoPointer(), ValueVar)117+ xStrvBuilderTake(x.GoPointer(), core.GStrdup(ValueVar))
118 118
119 }119 }
120 120
M v4/glib/gthread.go +7 -7
@@ -1830,11 +1830,11 @@ func (x *ThreadFunctions) GetPrivateSet() func(*Private, uintptr) {
1830 1830
1831 // OverrideThreadCreate sets the "thread_create" callback function.1831 // OverrideThreadCreate sets the "thread_create" callback function.
1832 // virtual function pointer for g_thread_create()1832 // virtual function pointer for g_thread_create()
1833-func (x *ThreadFunctions) OverrideThreadCreate(cb func(*ThreadFunc, uintptr, uint32, bool, bool, ThreadPriority, uintptr)) {1833+func (x *ThreadFunctions) OverrideThreadCreate(cb func(*ThreadFunc, uintptr, uint, bool, bool, ThreadPriority, uintptr)) {
1834 if cb == nil {1834 if cb == nil {
1835 x.xThreadCreate = 01835 x.xThreadCreate = 0
1836 } else {1836 } else {
1837- x.xThreadCreate = purego.NewCallback(func(FuncVarp uintptr, DataVarp uintptr, StackSizeVarp uint32, JoinableVarp bool, BoundVarp bool, PriorityVarp ThreadPriority, ThreadVarp uintptr) {1837+ x.xThreadCreate = purego.NewCallback(func(FuncVarp uintptr, DataVarp uintptr, StackSizeVarp uint, JoinableVarp bool, BoundVarp bool, PriorityVarp ThreadPriority, ThreadVarp uintptr) {
1838 cb((*ThreadFunc)(unsafe.Pointer(FuncVarp)), DataVarp, StackSizeVarp, JoinableVarp, BoundVarp, PriorityVarp, ThreadVarp)1838 cb((*ThreadFunc)(unsafe.Pointer(FuncVarp)), DataVarp, StackSizeVarp, JoinableVarp, BoundVarp, PriorityVarp, ThreadVarp)
1839 })1839 })
1840 }1840 }
@@ -1842,13 +1842,13 @@ func (x *ThreadFunctions) OverrideThreadCreate(cb func(*ThreadFunc, uintptr, uin
1842 1842
1843 // GetThreadCreate gets the "thread_create" callback function.1843 // GetThreadCreate gets the "thread_create" callback function.
1844 // virtual function pointer for g_thread_create()1844 // virtual function pointer for g_thread_create()
1845-func (x *ThreadFunctions) GetThreadCreate() func(*ThreadFunc, uintptr, uint32, bool, bool, ThreadPriority, uintptr) {1845+func (x *ThreadFunctions) GetThreadCreate() func(*ThreadFunc, uintptr, uint, bool, bool, ThreadPriority, uintptr) {
1846 if x.xThreadCreate == 0 {1846 if x.xThreadCreate == 0 {
1847 return nil1847 return nil
1848 }1848 }
1849- var rawCallback func(FuncVarp uintptr, DataVarp uintptr, StackSizeVarp uint32, JoinableVarp bool, BoundVarp bool, PriorityVarp ThreadPriority, ThreadVarp uintptr)1849+ var rawCallback func(FuncVarp uintptr, DataVarp uintptr, StackSizeVarp uint, JoinableVarp bool, BoundVarp bool, PriorityVarp ThreadPriority, ThreadVarp uintptr)
1850 purego.RegisterFunc(&rawCallback, x.xThreadCreate)1850 purego.RegisterFunc(&rawCallback, x.xThreadCreate)
1851- return func(FuncVar *ThreadFunc, DataVar uintptr, StackSizeVar uint32, JoinableVar bool, BoundVar bool, PriorityVar ThreadPriority, ThreadVar uintptr) {1851+ return func(FuncVar *ThreadFunc, DataVar uintptr, StackSizeVar uint, JoinableVar bool, BoundVar bool, PriorityVar ThreadPriority, ThreadVar uintptr) {
1852 rawCallback(NewCallback(FuncVar), DataVar, StackSizeVar, JoinableVar, BoundVar, PriorityVar, ThreadVar)1852 rawCallback(NewCallback(FuncVar), DataVar, StackSizeVar, JoinableVar, BoundVar, PriorityVar, ThreadVar)
1853 }1853 }
1854 }1854 }
@@ -2314,10 +2314,10 @@ func ThreadCreate(FuncVar *ThreadFunc, DataVar uintptr, JoinableVar bool) (*Thre
2314 2314
2315 }2315 }
2316 2316
2317-var xThreadCreateFull func(uintptr, uintptr, uint32, bool, bool, ThreadPriority, **Error) *Thread2317+var xThreadCreateFull func(uintptr, uintptr, uint, bool, bool, ThreadPriority, **Error) *Thread
2318 2318
2319 // This function creates a new thread.2319 // This function creates a new thread.
2320-func ThreadCreateFull(FuncVar *ThreadFunc, DataVar uintptr, StackSizeVar uint32, JoinableVar bool, BoundVar bool, PriorityVar ThreadPriority) (*Thread, error) {2320+func ThreadCreateFull(FuncVar *ThreadFunc, DataVar uintptr, StackSizeVar uint, JoinableVar bool, BoundVar bool, PriorityVar ThreadPriority) (*Thread, error) {
2321 var cerr *Error2321 var cerr *Error
2322 2322
2323 var FuncVarRef uintptr2323 var FuncVarRef uintptr
M v4/glib/gtimer.go +4 -4
@@ -42,7 +42,7 @@ func (x *Timer) Destroy() {
42 42
43 }43 }
44 44
45-var xTimerElapsed func(uintptr, uint32) float6445+var xTimerElapsed func(uintptr, uint) float64
46 46
47 // If @timer has been started but not stopped, obtains the time since47 // If @timer has been started but not stopped, obtains the time since
48 // the timer was started. If @timer has been stopped, obtains the48 // the timer was started. If @timer has been stopped, obtains the
@@ -50,7 +50,7 @@ var xTimerElapsed func(uintptr, uint32) float64
50 // stopped. The return value is the number of seconds elapsed,50 // stopped. The return value is the number of seconds elapsed,
51 // including any fractional part. The @microseconds out parameter is51 // including any fractional part. The @microseconds out parameter is
52 // essentially useless.52 // essentially useless.
53-func (x *Timer) Elapsed(MicrosecondsVar uint32) float64 {53+func (x *Timer) Elapsed(MicrosecondsVar uint) float64 {
54 54
55 cret := xTimerElapsed(x.GoPointer(), MicrosecondsVar)55 cret := xTimerElapsed(x.GoPointer(), MicrosecondsVar)
56 56
@@ -132,7 +132,7 @@ func TimeValFromIso8601(IsoDateVar string, TimeVar *TimeVal) bool {
132 return cret132 return cret
133 }133 }
134 134
135-var xUsleep func(uint32)135+var xUsleep func(uint)
136 136
137 // Pauses the current thread for the given number of microseconds.137 // Pauses the current thread for the given number of microseconds.
138 //138 //
@@ -140,7 +140,7 @@ var xUsleep func(uint32)
140 // %G_USEC_PER_SEC macro). g_usleep() may have limited precision,140 // %G_USEC_PER_SEC macro). g_usleep() may have limited precision,
141 // depending on hardware and operating system; don't rely on the exact141 // depending on hardware and operating system; don't rely on the exact
142 // length of the sleep.142 // length of the sleep.
143-func Usleep(MicrosecondsVar uint32) {143+func Usleep(MicrosecondsVar uint) {
144 144
145 xUsleep(MicrosecondsVar)145 xUsleep(MicrosecondsVar)
146 146
M v4/glib/gtypes.go +4 -4
@@ -106,20 +106,20 @@ type TranslateFunc func(string, uintptr) string
106 type TimeVal struct {106 type TimeVal struct {
107 _ structs.HostLayout107 _ structs.HostLayout
108 108
109- TvSec int32109+ TvSec int
110 110
111- TvUsec int32111+ TvUsec int
112 }112 }
113 113
114 func (x *TimeVal) GoPointer() uintptr {114 func (x *TimeVal) GoPointer() uintptr {
115 return uintptr(unsafe.Pointer(x))115 return uintptr(unsafe.Pointer(x))
116 }116 }
117 117
118-var xTimeValAdd func(uintptr, int32)118+var xTimeValAdd func(uintptr, int)
119 119
120 // Adds the given number of microseconds to @time_. @microseconds can120 // Adds the given number of microseconds to @time_. @microseconds can
121 // also be negative to decrease the value of @time_.121 // also be negative to decrease the value of @time_.
122-func (x *TimeVal) Add(MicrosecondsVar int32) {122+func (x *TimeVal) Add(MicrosecondsVar int) {
123 123
124 xTimeValAdd(x.GoPointer(), MicrosecondsVar)124 xTimeValAdd(x.GoPointer(), MicrosecondsVar)
125 125
M v4/glib/gunicode.go +22 -22
@@ -615,12 +615,12 @@ const (
615 GUnicodeSpaceSeparatorValue UnicodeType = 29615 GUnicodeSpaceSeparatorValue UnicodeType = 29
616 )616 )
617 617
618-var xUcs4ToUtf16 func([]uint32, int32, *int32, *int32, **Error) uint16618+var xUcs4ToUtf16 func([]uint32, int, *int, *int, **Error) uint16
619 619
620 // Convert a string from UCS-4 to UTF-16.620 // Convert a string from UCS-4 to UTF-16.
621 //621 //
622 // A nul character (U+0000) will be added to the result after the converted text.622 // A nul character (U+0000) will be added to the result after the converted text.
623-func Ucs4ToUtf16(StrVar []uint32, LenVar int32, ItemsReadVar *int32, ItemsWrittenVar *int32) (uint16, error) {623+func Ucs4ToUtf16(StrVar []uint32, LenVar int, ItemsReadVar *int, ItemsWrittenVar *int) (uint16, error) {
624 var cerr *Error624 var cerr *Error
625 625
626 cret := xUcs4ToUtf16(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)626 cret := xUcs4ToUtf16(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)
@@ -632,13 +632,13 @@ func Ucs4ToUtf16(StrVar []uint32, LenVar int32, ItemsReadVar *int32, ItemsWritte
632 632
633 }633 }
634 634
635-var xUcs4ToUtf8 func([]uint32, int32, *int32, *int32, **Error) string635+var xUcs4ToUtf8 func([]uint32, int, *int, *int, **Error) string
636 636
637 // Convert a string from a 32-bit fixed width representation as UCS-4.637 // Convert a string from a 32-bit fixed width representation as UCS-4.
638 // to UTF-8.638 // to UTF-8.
639 //639 //
640 // The result will be terminated with a nul byte.640 // The result will be terminated with a nul byte.
641-func Ucs4ToUtf8(StrVar []uint32, LenVar int32, ItemsReadVar *int32, ItemsWrittenVar *int32) (string, error) {641+func Ucs4ToUtf8(StrVar []uint32, LenVar int, ItemsReadVar *int, ItemsWrittenVar *int) (string, error) {
642 var cerr *Error642 var cerr *Error
643 643
644 cret := xUcs4ToUtf8(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)644 cret := xUcs4ToUtf8(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)
@@ -1164,12 +1164,12 @@ func UnicodeScriptToIso15924(ScriptVar UnicodeScript) uint32 {
1164 return cret1164 return cret
1165 }1165 }
1166 1166
1167-var xUtf16ToUcs4 func([]uint16, int32, *int32, *int32, **Error) uint321167+var xUtf16ToUcs4 func([]uint16, int, *int, *int, **Error) uint32
1168 1168
1169 // Convert a string from UTF-16 to UCS-4.1169 // Convert a string from UTF-16 to UCS-4.
1170 //1170 //
1171 // The result will be nul-terminated.1171 // The result will be nul-terminated.
1172-func Utf16ToUcs4(StrVar []uint16, LenVar int32, ItemsReadVar *int32, ItemsWrittenVar *int32) (uint32, error) {1172+func Utf16ToUcs4(StrVar []uint16, LenVar int, ItemsReadVar *int, ItemsWrittenVar *int) (uint32, error) {
1173 var cerr *Error1173 var cerr *Error
1174 1174
1175 cret := xUtf16ToUcs4(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)1175 cret := xUtf16ToUcs4(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)
@@ -1181,7 +1181,7 @@ func Utf16ToUcs4(StrVar []uint16, LenVar int32, ItemsReadVar *int32, ItemsWritte
1181 1181
1182 }1182 }
1183 1183
1184-var xUtf16ToUtf8 func([]uint16, int32, *int32, *int32, **Error) string1184+var xUtf16ToUtf8 func([]uint16, int, *int, *int, **Error) string
1185 1185
1186 // Convert a string from UTF-16 to UTF-8.1186 // Convert a string from UTF-16 to UTF-8.
1187 //1187 //
@@ -1197,7 +1197,7 @@ var xUtf16ToUtf8 func([]uint16, int32, *int32, *int32, **Error) string
1197 // validation done by this function is to ensure that the input can1197 // validation done by this function is to ensure that the input can
1198 // be correctly interpreted as UTF-16, i.e. it doesn’t contain1198 // be correctly interpreted as UTF-16, i.e. it doesn’t contain
1199 // unpaired surrogates or partial character sequences.1199 // unpaired surrogates or partial character sequences.
1200-func Utf16ToUtf8(StrVar []uint16, LenVar int32, ItemsReadVar *int32, ItemsWrittenVar *int32) (string, error) {1200+func Utf16ToUtf8(StrVar []uint16, LenVar int, ItemsReadVar *int, ItemsWrittenVar *int) (string, error) {
1201 var cerr *Error1201 var cerr *Error
1202 1202
1203 cret := xUtf16ToUtf8(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)1203 cret := xUtf16ToUtf8(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)
@@ -1418,7 +1418,7 @@ func Utf8Normalize(StrVar string, LenVar int, ModeVar NormalizeMode) string {
1418 return cret1418 return cret
1419 }1419 }
1420 1420
1421-var xUtf8OffsetToPointer func(string, int32) string1421+var xUtf8OffsetToPointer func(string, int) string
1422 1422
1423 // Converts from an integer character offset to a pointer to a position1423 // Converts from an integer character offset to a pointer to a position
1424 // within the string.1424 // within the string.
@@ -1433,21 +1433,21 @@ var xUtf8OffsetToPointer func(string, int32) string
1433 // before calling that function. Call [func@GLib.utf8_strlen] when unsure.1433 // before calling that function. Call [func@GLib.utf8_strlen] when unsure.
1434 // This limitation exists as this function is called frequently during1434 // This limitation exists as this function is called frequently during
1435 // text rendering and therefore has to be as fast as possible.1435 // text rendering and therefore has to be as fast as possible.
1436-func Utf8OffsetToPointer(StrVar string, OffsetVar int32) string {1436+func Utf8OffsetToPointer(StrVar string, OffsetVar int) string {
1437 1437
1438 cret := xUtf8OffsetToPointer(StrVar, OffsetVar)1438 cret := xUtf8OffsetToPointer(StrVar, OffsetVar)
1439 1439
1440 return cret1440 return cret
1441 }1441 }
1442 1442
1443-var xUtf8PointerToOffset func(string, string) int321443+var xUtf8PointerToOffset func(string, string) int
1444 1444
1445 // Converts from a pointer to position within a string to an integer1445 // Converts from a pointer to position within a string to an integer
1446 // character offset.1446 // character offset.
1447 //1447 //
1448 // Since 2.10, this function allows @pos to be before @str, and returns1448 // Since 2.10, this function allows @pos to be before @str, and returns
1449 // a negative offset in this case.1449 // a negative offset in this case.
1450-func Utf8PointerToOffset(StrVar string, PosVar string) int32 {1450+func Utf8PointerToOffset(StrVar string, PosVar string) int {
1451 1451
1452 cret := xUtf8PointerToOffset(StrVar, PosVar)1452 cret := xUtf8PointerToOffset(StrVar, PosVar)
1453 1453
@@ -1496,12 +1496,12 @@ func Utf8Strdown(StrVar string, LenVar int) string {
1496 return cret1496 return cret
1497 }1497 }
1498 1498
1499-var xUtf8Strlen func(string, int) int321499+var xUtf8Strlen func(string, int) int
1500 1500
1501 // Computes the length of the string in characters, not including1501 // Computes the length of the string in characters, not including
1502 // the terminating nul character. If the @max’th byte falls in the1502 // the terminating nul character. If the @max’th byte falls in the
1503 // middle of a character, the last (partial) character is not counted.1503 // middle of a character, the last (partial) character is not counted.
1504-func Utf8Strlen(PVar string, MaxVar int) int32 {1504+func Utf8Strlen(PVar string, MaxVar int) int {
1505 1505
1506 cret := xUtf8Strlen(PVar, MaxVar)1506 cret := xUtf8Strlen(PVar, MaxVar)
1507 1507
@@ -1576,27 +1576,27 @@ func Utf8Strup(StrVar string, LenVar int) string {
1576 return cret1576 return cret
1577 }1577 }
1578 1578
1579-var xUtf8Substring func(string, int32, int32) string1579+var xUtf8Substring func(string, int, int) string
1580 1580
1581 // Copies a substring out of a UTF-8 encoded string.1581 // Copies a substring out of a UTF-8 encoded string.
1582 // The substring will contain @end_pos - @start_pos characters.1582 // The substring will contain @end_pos - @start_pos characters.
1583 //1583 //
1584 // Since GLib 2.72, `-1` can be passed to @end_pos to indicate the1584 // Since GLib 2.72, `-1` can be passed to @end_pos to indicate the
1585 // end of the string.1585 // end of the string.
1586-func Utf8Substring(StrVar string, StartPosVar int32, EndPosVar int32) string {1586+func Utf8Substring(StrVar string, StartPosVar int, EndPosVar int) string {
1587 1587
1588 cret := xUtf8Substring(StrVar, StartPosVar, EndPosVar)1588 cret := xUtf8Substring(StrVar, StartPosVar, EndPosVar)
1589 1589
1590 return cret1590 return cret
1591 }1591 }
1592 1592
1593-var xUtf8ToUcs4 func(string, int32, *int32, *int32, **Error) uint321593+var xUtf8ToUcs4 func(string, int, *int, *int, **Error) uint32
1594 1594
1595 // Convert a string from UTF-8 to a 32-bit fixed width representation as UCS-4.1595 // Convert a string from UTF-8 to a 32-bit fixed width representation as UCS-4.
1596 //1596 //
1597 // A trailing nul character (U+0000) will be added to the string after the1597 // A trailing nul character (U+0000) will be added to the string after the
1598 // converted text.1598 // converted text.
1599-func Utf8ToUcs4(StrVar string, LenVar int32, ItemsReadVar *int32, ItemsWrittenVar *int32) (uint32, error) {1599+func Utf8ToUcs4(StrVar string, LenVar int, ItemsReadVar *int, ItemsWrittenVar *int) (uint32, error) {
1600 var cerr *Error1600 var cerr *Error
1601 1601
1602 cret := xUtf8ToUcs4(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)1602 cret := xUtf8ToUcs4(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)
@@ -1608,7 +1608,7 @@ func Utf8ToUcs4(StrVar string, LenVar int32, ItemsReadVar *int32, ItemsWrittenVa
1608 1608
1609 }1609 }
1610 1610
1611-var xUtf8ToUcs4Fast func(string, int32, *int32) uint321611+var xUtf8ToUcs4Fast func(string, int, *int) uint32
1612 1612
1613 // Convert a string from UTF-8 to a 32-bit fixed width1613 // Convert a string from UTF-8 to a 32-bit fixed width
1614 // representation as UCS-4, assuming valid UTF-8 input.1614 // representation as UCS-4, assuming valid UTF-8 input.
@@ -1616,19 +1616,19 @@ var xUtf8ToUcs4Fast func(string, int32, *int32) uint32
1616 // This function is roughly twice as fast as [func@GLib.utf8_to_ucs4]1616 // This function is roughly twice as fast as [func@GLib.utf8_to_ucs4]
1617 // but does no error checking on the input. A trailing nul character (U+0000)1617 // but does no error checking on the input. A trailing nul character (U+0000)
1618 // will be added to the string after the converted text.1618 // will be added to the string after the converted text.
1619-func Utf8ToUcs4Fast(StrVar string, LenVar int32, ItemsWrittenVar *int32) uint32 {1619+func Utf8ToUcs4Fast(StrVar string, LenVar int, ItemsWrittenVar *int) uint32 {
1620 1620
1621 cret := xUtf8ToUcs4Fast(StrVar, LenVar, ItemsWrittenVar)1621 cret := xUtf8ToUcs4Fast(StrVar, LenVar, ItemsWrittenVar)
1622 1622
1623 return cret1623 return cret
1624 }1624 }
1625 1625
1626-var xUtf8ToUtf16 func(string, int32, *int32, *int32, **Error) uint161626+var xUtf8ToUtf16 func(string, int, *int, *int, **Error) uint16
1627 1627
1628 // Convert a string from UTF-8 to UTF-16.1628 // Convert a string from UTF-8 to UTF-16.
1629 //1629 //
1630 // A nul character (U+0000) will be added to the result after the converted text.1630 // A nul character (U+0000) will be added to the result after the converted text.
1631-func Utf8ToUtf16(StrVar string, LenVar int32, ItemsReadVar *int32, ItemsWrittenVar *int32) (uint16, error) {1631+func Utf8ToUtf16(StrVar string, LenVar int, ItemsReadVar *int, ItemsWrittenVar *int) (uint16, error) {
1632 var cerr *Error1632 var cerr *Error
1633 1633
1634 cret := xUtf8ToUtf16(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)1634 cret := xUtf8ToUtf16(StrVar, LenVar, ItemsReadVar, ItemsWrittenVar, &cerr)
M v4/glib/gutils.go +10 -10
@@ -141,38 +141,38 @@ func Atexit(FuncVar *VoidFunc) {
141 141
142 }142 }
143 143
144-var xBitNthLsf func(uint32, int) int144+var xBitNthLsf func(uint, int) int
145 145
146 // Find the position of the first bit set in @mask, searching146 // Find the position of the first bit set in @mask, searching
147 // from (but not including) @nth_bit upwards. Bits are numbered147 // from (but not including) @nth_bit upwards. Bits are numbered
148 // from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,148 // from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,
149 // usually). To start searching from the 0th bit, set @nth_bit to -1.149 // usually). To start searching from the 0th bit, set @nth_bit to -1.
150-func BitNthLsf(MaskVar uint32, NthBitVar int) int {150+func BitNthLsf(MaskVar uint, NthBitVar int) int {
151 151
152 cret := xBitNthLsf(MaskVar, NthBitVar)152 cret := xBitNthLsf(MaskVar, NthBitVar)
153 153
154 return cret154 return cret
155 }155 }
156 156
157-var xBitNthMsf func(uint32, int) int157+var xBitNthMsf func(uint, int) int
158 158
159 // Find the position of the first bit set in @mask, searching159 // Find the position of the first bit set in @mask, searching
160 // from (but not including) @nth_bit downwards. Bits are numbered160 // from (but not including) @nth_bit downwards. Bits are numbered
161 // from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,161 // from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,
162 // usually). To start searching from the last bit, set @nth_bit to162 // usually). To start searching from the last bit, set @nth_bit to
163 // -1 or GLIB_SIZEOF_LONG * 8.163 // -1 or GLIB_SIZEOF_LONG * 8.
164-func BitNthMsf(MaskVar uint32, NthBitVar int) int {164+func BitNthMsf(MaskVar uint, NthBitVar int) int {
165 165
166 cret := xBitNthMsf(MaskVar, NthBitVar)166 cret := xBitNthMsf(MaskVar, NthBitVar)
167 167
168 return cret168 return cret
169 }169 }
170 170
171-var xBitStorage func(uint32) uint171+var xBitStorage func(uint) uint
172 172
173 // Gets the number of bits used to hold @number,173 // Gets the number of bits used to hold @number,
174 // e.g. if @number is 4, 3 bits are needed.174 // e.g. if @number is 4, 3 bits are needed.
175-func BitStorage(NumberVar uint32) uint {175+func BitStorage(NumberVar uint) uint {
176 176
177 cret := xBitStorage(NumberVar)177 cret := xBitStorage(NumberVar)
178 178
@@ -718,7 +718,7 @@ func SetPrgname(PrgnameVar string) {
718 718
719 }719 }
720 720
721-var xSnprintf func(string, uint32, string, ...interface{}) int721+var xSnprintf func(string, uint, string, ...interface{}) int
722 722
723 // A safer form of the standard sprintf() function. The output is guaranteed723 // A safer form of the standard sprintf() function. The output is guaranteed
724 // to not exceed @n characters (including the terminating nul character), so724 // to not exceed @n characters (including the terminating nul character), so
@@ -737,14 +737,14 @@ var xSnprintf func(string, uint32, string, ...interface{}) int
737 //737 //
738 // The format string may contain positional parameters, as specified in738 // The format string may contain positional parameters, as specified in
739 // the Single Unix Specification.739 // the Single Unix Specification.
740-func Snprintf(StringVar string, NVar uint32, FormatVar string, varArgs ...interface{}) int {740+func Snprintf(StringVar string, NVar uint, FormatVar string, varArgs ...interface{}) int {
741 741
742 cret := xSnprintf(StringVar, NVar, FormatVar, varArgs...)742 cret := xSnprintf(StringVar, NVar, FormatVar, varArgs...)
743 743
744 return cret744 return cret
745 }745 }
746 746
747-var xVsnprintf func(string, uint32, string, []interface{}) int747+var xVsnprintf func(string, uint, string, []interface{}) int
748 748
749 // A safer form of the standard `vsprintf()` function. The output is guaranteed749 // A safer form of the standard `vsprintf()` function. The output is guaranteed
750 // to not exceed @n characters (including the terminating nul character), so750 // to not exceed @n characters (including the terminating nul character), so
@@ -763,7 +763,7 @@ var xVsnprintf func(string, uint32, string, []interface{}) int
763 //763 //
764 // The format string may contain positional parameters, as specified in764 // The format string may contain positional parameters, as specified in
765 // the Single Unix Specification.765 // the Single Unix Specification.
766-func Vsnprintf(StringVar string, NVar uint32, FormatVar string, ArgsVar []interface{}) int {766+func Vsnprintf(StringVar string, NVar uint, FormatVar string, ArgsVar []interface{}) int {
767 767
768 cret := xVsnprintf(StringVar, NVar, FormatVar, ArgsVar)768 cret := xVsnprintf(StringVar, NVar, FormatVar, ArgsVar)
769 769
M v4/glib/more.go +25 -4
@@ -11,11 +11,13 @@ import (
11 11
12 var callbacks = struct {12 var callbacks = struct {
13 sync.RWMutex13 sync.RWMutex
14- refs map[uintptr]uintptr14+ refs map[uintptr]uintptr
15- closures map[uintptr]interface{}15+ closures map[uintptr]interface{}
16+ handlerToCallback map[uint]uintptr
16 }{17 }{
17- refs: make(map[uintptr]uintptr),18+ refs: make(map[uintptr]uintptr),
18- closures: make(map[uintptr]interface{}),19+ closures: make(map[uintptr]interface{}),
20+ handlerToCallback: make(map[uint]uintptr),
19 }21 }
20 22
21 // GetCallback retrives a callback reference by value.23 // GetCallback retrives a callback reference by value.
@@ -55,6 +57,25 @@ func RemoveCallback(cbPtr uintptr) {
55 callbacks.Unlock()57 callbacks.Unlock()
56 }58 }
57 59
60+// SaveHandlerMapping records a signal handler ID → callback pointer mapping
61+// so that DisconnectSignal can clean up the callback registry.
62+func SaveHandlerMapping(handlerID uint, cbPtr uintptr) {
63+ callbacks.Lock()
64+ callbacks.handlerToCallback[handlerID] = cbPtr
65+ callbacks.Unlock()
66+}
67+
68+// RemoveCallbackByHandler removes a callback from the registry using a signal handler ID.
69+func RemoveCallbackByHandler(handlerID uint) {
70+ callbacks.Lock()
71+ if cbPtr, ok := callbacks.handlerToCallback[handlerID]; ok {
72+ delete(callbacks.refs, cbPtr)
73+ delete(callbacks.closures, cbPtr)
74+ delete(callbacks.handlerToCallback, handlerID)
75+ }
76+ callbacks.Unlock()
77+}
78+
58 // UnrefCallbackValue unreferences the provided callback by reflect.value to free a purego slot79 // UnrefCallbackValue unreferences the provided callback by reflect.value to free a purego slot
59 //80 //
60 // NOTE: Windows does not support unreferencing callbacks, so on that platform this operation is81 // NOTE: Windows does not support unreferencing callbacks, so on that platform this operation is
M v4/gobject/gobject.go +16 -8
@@ -1000,7 +1000,7 @@ func ClearObject(ObjectPtrVar **Object) {
1000 1000
1001 }1001 }
1002 1002
1003-var xSignalConnectObject func(*TypeInstance, string, uintptr, uintptr, ConnectFlags) uint321003+var xSignalConnectObject func(*TypeInstance, string, uintptr, uintptr, ConnectFlags) uint
1004 1004
1005 // This is similar to g_signal_connect_data(), but uses a closure which1005 // This is similar to g_signal_connect_data(), but uses a closure which
1006 // ensures that the @gobject stays alive during the call to @c_handler1006 // ensures that the @gobject stays alive during the call to @c_handler
@@ -1018,7 +1018,7 @@ var xSignalConnectObject func(*TypeInstance, string, uintptr, uintptr, ConnectFl
1018 //1018 //
1019 // Refer to the [signals documentation](signals.html) for more1019 // Refer to the [signals documentation](signals.html) for more
1020 // details.1020 // details.
1021-func SignalConnectObject(InstanceVar *TypeInstance, DetailedSignalVar string, CHandlerVar *Callback, GobjectVar *Object, ConnectFlagsVar ConnectFlags) uint32 {1021+func SignalConnectObject(InstanceVar *TypeInstance, DetailedSignalVar string, CHandlerVar *Callback, GobjectVar *Object, ConnectFlagsVar ConnectFlags) uint {
1022 1022
1023 var CHandlerVarRef uintptr1023 var CHandlerVarRef uintptr
1024 if CHandlerVar != nil {1024 if CHandlerVar != nil {
@@ -2359,10 +2359,12 @@ func (c *Object) SetGoPointer(ptr uintptr) {
2359 // It is important to note that you must use2359 // It is important to note that you must use
2360 // [canonical parameter names][class@GObject.ParamSpec#parameter-names] as2360 // [canonical parameter names][class@GObject.ParamSpec#parameter-names] as
2361 // detail strings for the notify signal.2361 // detail strings for the notify signal.
2362-func (x *Object) ConnectNotify(cb *func(Object, uintptr)) uint32 {2362+func (x *Object) ConnectNotify(cb *func(Object, uintptr)) uint {
2363 cbPtr := uintptr(unsafe.Pointer(cb))2363 cbPtr := uintptr(unsafe.Pointer(cb))
2364 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2364 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2365- return SignalConnect(x.GoPointer(), "notify", cbRefPtr)2365+ handlerID := SignalConnect(x.GoPointer(), "notify", cbRefPtr)
2366+ glib.SaveHandlerMapping(handlerID, cbPtr)
2367+ return handlerID
2366 }2368 }
2367 2369
2368 fcb := func(clsPtr uintptr, PspecVarp uintptr) {2370 fcb := func(clsPtr uintptr, PspecVarp uintptr) {
@@ -2375,16 +2377,20 @@ func (x *Object) ConnectNotify(cb *func(Object, uintptr)) uint32 {
2375 }2377 }
2376 cbRefPtr := purego.NewCallback(fcb)2378 cbRefPtr := purego.NewCallback(fcb)
2377 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2379 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2378- return SignalConnect(x.GoPointer(), "notify", cbRefPtr)2380+ handlerID := SignalConnect(x.GoPointer(), "notify", cbRefPtr)
2381+ glib.SaveHandlerMapping(handlerID, cbPtr)
2382+ return handlerID
2379 }2383 }
2380 2384
2381 // ConnectNotifyWithDetail connects to the "notify" signal with a detail string.2385 // ConnectNotifyWithDetail connects to the "notify" signal with a detail string.
2382 // The detail is appended as "notify::<detail>".2386 // The detail is appended as "notify::<detail>".
2383-func (x *Object) ConnectNotifyWithDetail(detail string, cb *func(Object, uintptr)) uint32 {2387+func (x *Object) ConnectNotifyWithDetail(detail string, cb *func(Object, uintptr)) uint {
2384 cbPtr := uintptr(unsafe.Pointer(cb))2388 cbPtr := uintptr(unsafe.Pointer(cb))
2385 signalName := fmt.Sprintf("notify::%s", detail)2389 signalName := fmt.Sprintf("notify::%s", detail)
2386 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2390 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2387- return SignalConnect(x.GoPointer(), signalName, cbRefPtr)2391+ handlerID := SignalConnect(x.GoPointer(), signalName, cbRefPtr)
2392+ glib.SaveHandlerMapping(handlerID, cbPtr)
2393+ return handlerID
2388 }2394 }
2389 2395
2390 fcb := func(clsPtr uintptr, PspecVarp uintptr) {2396 fcb := func(clsPtr uintptr, PspecVarp uintptr) {
@@ -2397,7 +2403,9 @@ func (x *Object) ConnectNotifyWithDetail(detail string, cb *func(Object, uintptr
2397 }2403 }
2398 cbRefPtr := purego.NewCallback(fcb)2404 cbRefPtr := purego.NewCallback(fcb)
2399 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2405 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2400- return SignalConnect(x.GoPointer(), signalName, cbRefPtr)2406+ handlerID := SignalConnect(x.GoPointer(), signalName, cbRefPtr)
2407+ glib.SaveHandlerMapping(handlerID, cbPtr)
2408+ return handlerID
2401 }2409 }
2402 2410
2403 var xObjectCompatControl func(uint, uintptr) uint2411 var xObjectCompatControl func(uint, uintptr) uint
M v4/gobject/gparamspecs.go +4 -4
@@ -277,12 +277,12 @@ func NewParamSpecInt64(NameVar string, NickVar *string, BlurbVar *string, Minimu
277 return cls277 return cls
278 }278 }
279 279
280-var xNewParamSpecLong func(string, uintptr, uintptr, int32, int32, int32, ParamFlags) uintptr280+var xNewParamSpecLong func(string, uintptr, uintptr, int, int, int, ParamFlags) uintptr
281 281
282 // Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.282 // Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property.
283 //283 //
284 // See g_param_spec_internal() for details on property names.284 // See g_param_spec_internal() for details on property names.
285-func NewParamSpecLong(NameVar string, NickVar *string, BlurbVar *string, MinimumVar int32, MaximumVar int32, DefaultValueVar int32, FlagsVar ParamFlags) *ParamSpec {285+func NewParamSpecLong(NameVar string, NickVar *string, BlurbVar *string, MinimumVar int, MaximumVar int, DefaultValueVar int, FlagsVar ParamFlags) *ParamSpec {
286 var cls *ParamSpec286 var cls *ParamSpec
287 287
288 NickVarPtr, NickVarBytes := core.NullableStringToPtr(NickVar)288 NickVarPtr, NickVarBytes := core.NullableStringToPtr(NickVar)
@@ -510,13 +510,13 @@ func ParamSpecUint64(NameVar string, NickVar *string, BlurbVar *string, MinimumV
510 return cls510 return cls
511 }511 }
512 512
513-var xParamSpecUlong func(string, uintptr, uintptr, uint32, uint32, uint32, ParamFlags) uintptr513+var xParamSpecUlong func(string, uintptr, uintptr, uint, uint, uint, ParamFlags) uintptr
514 514
515 // Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG515 // Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG
516 // property.516 // property.
517 //517 //
518 // See g_param_spec_internal() for details on property names.518 // See g_param_spec_internal() for details on property names.
519-func ParamSpecUlong(NameVar string, NickVar *string, BlurbVar *string, MinimumVar uint32, MaximumVar uint32, DefaultValueVar uint32, FlagsVar ParamFlags) *ParamSpec {519+func ParamSpecUlong(NameVar string, NickVar *string, BlurbVar *string, MinimumVar uint, MaximumVar uint, DefaultValueVar uint, FlagsVar ParamFlags) *ParamSpec {
520 var cls *ParamSpec520 var cls *ParamSpec
521 521
522 NickVarPtr, NickVarBytes := core.NullableStringToPtr(NickVar)522 NickVarPtr, NickVarBytes := core.NullableStringToPtr(NickVar)
M v4/gobject/gsignal.go +22 -22
@@ -172,7 +172,7 @@ const (
172 GSignalMatchUnblockedValue SignalMatchType = 32172 GSignalMatchUnblockedValue SignalMatchType = 32
173 )173 )
174 174
175-var xClearSignalHandler func(uint32, uintptr)175+var xClearSignalHandler func(uint, uintptr)
176 176
177 // Disconnects a handler from @instance so it will not be called during177 // Disconnects a handler from @instance so it will not be called during
178 // any future or currently ongoing emissions of the signal it has been178 // any future or currently ongoing emissions of the signal it has been
@@ -182,7 +182,7 @@ var xClearSignalHandler func(uint32, uintptr)
182 //182 //
183 // There is also a macro version of this function so that the code183 // There is also a macro version of this function so that the code
184 // will be inlined.184 // will be inlined.
185-func ClearSignalHandler(HandlerIdPtrVar uint32, InstanceVar *Object) {185+func ClearSignalHandler(HandlerIdPtrVar uint, InstanceVar *Object) {
186 186
187 xClearSignalHandler(HandlerIdPtrVar, InstanceVar.GoPointer())187 xClearSignalHandler(HandlerIdPtrVar, InstanceVar.GoPointer())
188 188
@@ -223,12 +223,12 @@ func SignalAccumulatorTrueHandled(IhintVar *SignalInvocationHint, ReturnAccuVar
223 return cret223 return cret
224 }224 }
225 225
226-var xSignalAddEmissionHook func(uint, glib.Quark, uintptr, uintptr, uintptr) uint32226+var xSignalAddEmissionHook func(uint, glib.Quark, uintptr, uintptr, uintptr) uint
227 227
228 // Adds an emission hook for a signal, which will get called for any emission228 // Adds an emission hook for a signal, which will get called for any emission
229 // of that signal, independent of the instance. This is possible only229 // of that signal, independent of the instance. This is possible only
230 // for signals which don't have %G_SIGNAL_NO_HOOKS flag set.230 // for signals which don't have %G_SIGNAL_NO_HOOKS flag set.
231-func SignalAddEmissionHook(SignalIdVar uint, DetailVar glib.Quark, HookFuncVar *SignalEmissionHook, HookDataVar uintptr, DataDestroyVar *glib.DestroyNotify) uint32 {231+func SignalAddEmissionHook(SignalIdVar uint, DetailVar glib.Quark, HookFuncVar *SignalEmissionHook, HookDataVar uintptr, DataDestroyVar *glib.DestroyNotify) uint {
232 232
233 var HookFuncVarRef uintptr233 var HookFuncVarRef uintptr
234 if HookFuncVar != nil {234 if HookFuncVar != nil {
@@ -289,7 +289,7 @@ func SignalChainFromOverriddenHandler(InstanceVar *TypeInstance, varArgs ...inte
289 289
290 }290 }
291 291
292-var xSignalConnectClosure func(uintptr, string, *Closure, bool) uint32292+var xSignalConnectClosure func(uintptr, string, *Closure, bool) uint
293 293
294 // Connects a closure to a signal for a particular object.294 // Connects a closure to a signal for a particular object.
295 //295 //
@@ -303,14 +303,14 @@ var xSignalConnectClosure func(uintptr, string, *Closure, bool) uint32
303 //303 //
304 // Refer to the [signals documentation](signals.html) for more304 // Refer to the [signals documentation](signals.html) for more
305 // details.305 // details.
306-func SignalConnectClosure(InstanceVar *Object, DetailedSignalVar string, ClosureVar *Closure, AfterVar bool) uint32 {306+func SignalConnectClosure(InstanceVar *Object, DetailedSignalVar string, ClosureVar *Closure, AfterVar bool) uint {
307 307
308 cret := xSignalConnectClosure(InstanceVar.GoPointer(), DetailedSignalVar, ClosureVar, AfterVar)308 cret := xSignalConnectClosure(InstanceVar.GoPointer(), DetailedSignalVar, ClosureVar, AfterVar)
309 309
310 return cret310 return cret
311 }311 }
312 312
313-var xSignalConnectClosureById func(uintptr, uint, glib.Quark, *Closure, bool) uint32313+var xSignalConnectClosureById func(uintptr, uint, glib.Quark, *Closure, bool) uint
314 314
315 // Connects a closure to a signal for a particular object.315 // Connects a closure to a signal for a particular object.
316 //316 //
@@ -324,14 +324,14 @@ var xSignalConnectClosureById func(uintptr, uint, glib.Quark, *Closure, bool) ui
324 //324 //
325 // Refer to the [signals documentation](signals.html) for more325 // Refer to the [signals documentation](signals.html) for more
326 // details.326 // details.
327-func SignalConnectClosureById(InstanceVar *Object, SignalIdVar uint, DetailVar glib.Quark, ClosureVar *Closure, AfterVar bool) uint32 {327+func SignalConnectClosureById(InstanceVar *Object, SignalIdVar uint, DetailVar glib.Quark, ClosureVar *Closure, AfterVar bool) uint {
328 328
329 cret := xSignalConnectClosureById(InstanceVar.GoPointer(), SignalIdVar, DetailVar, ClosureVar, AfterVar)329 cret := xSignalConnectClosureById(InstanceVar.GoPointer(), SignalIdVar, DetailVar, ClosureVar, AfterVar)
330 330
331 return cret331 return cret
332 }332 }
333 333
334-var xSignalConnectData func(uintptr, string, uintptr, uintptr, uintptr, ConnectFlags) uint32334+var xSignalConnectData func(uintptr, string, uintptr, uintptr, uintptr, ConnectFlags) uint
335 335
336 // Connects a #GCallback function to a signal for a particular object. Similar336 // Connects a #GCallback function to a signal for a particular object. Similar
337 // to g_signal_connect(), but allows to provide a #GClosureNotify for the data337 // to g_signal_connect(), but allows to provide a #GClosureNotify for the data
@@ -346,7 +346,7 @@ var xSignalConnectData func(uintptr, string, uintptr, uintptr, uintptr, ConnectF
346 //346 //
347 // Refer to the [signals documentation](signals.html) for more347 // Refer to the [signals documentation](signals.html) for more
348 // details.348 // details.
349-func SignalConnectData(InstanceVar *Object, DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr, DestroyDataVar *ClosureNotify, ConnectFlagsVar ConnectFlags) uint32 {349+func SignalConnectData(InstanceVar *Object, DetailedSignalVar string, CHandlerVar *Callback, DataVar uintptr, DestroyDataVar *ClosureNotify, ConnectFlagsVar ConnectFlags) uint {
350 350
351 var CHandlerVarRef uintptr351 var CHandlerVarRef uintptr
352 if CHandlerVar != nil {352 if CHandlerVar != nil {
@@ -445,7 +445,7 @@ func SignalGetInvocationHint(InstanceVar *Object) *SignalInvocationHint {
445 return cret445 return cret
446 }446 }
447 447
448-var xSignalHandlerBlock func(uintptr, uint32)448+var xSignalHandlerBlock func(uintptr, uint)
449 449
450 // Blocks a handler of an instance so it will not be called during any450 // Blocks a handler of an instance so it will not be called during any
451 // signal emissions unless it is unblocked again. Thus "blocking" a451 // signal emissions unless it is unblocked again. Thus "blocking" a
@@ -455,13 +455,13 @@ var xSignalHandlerBlock func(uintptr, uint32)
455 //455 //
456 // The @handler_id has to be a valid signal handler id, connected to a456 // The @handler_id has to be a valid signal handler id, connected to a
457 // signal of @instance.457 // signal of @instance.
458-func SignalHandlerBlock(InstanceVar *Object, HandlerIdVar uint32) {458+func SignalHandlerBlock(InstanceVar *Object, HandlerIdVar uint) {
459 459
460 xSignalHandlerBlock(InstanceVar.GoPointer(), HandlerIdVar)460 xSignalHandlerBlock(InstanceVar.GoPointer(), HandlerIdVar)
461 461
462 }462 }
463 463
464-var xSignalHandlerDisconnect func(uintptr, uint32)464+var xSignalHandlerDisconnect func(uintptr, uint)
465 465
466 // Disconnects a handler from an instance so it will not be called during466 // Disconnects a handler from an instance so it will not be called during
467 // any future or currently ongoing emissions of the signal it has been467 // any future or currently ongoing emissions of the signal it has been
@@ -469,37 +469,37 @@ var xSignalHandlerDisconnect func(uintptr, uint32)
469 //469 //
470 // The @handler_id has to be a valid signal handler id, connected to a470 // The @handler_id has to be a valid signal handler id, connected to a
471 // signal of @instance.471 // signal of @instance.
472-func SignalHandlerDisconnect(InstanceVar *Object, HandlerIdVar uint32) {472+func SignalHandlerDisconnect(InstanceVar *Object, HandlerIdVar uint) {
473 473
474 xSignalHandlerDisconnect(InstanceVar.GoPointer(), HandlerIdVar)474 xSignalHandlerDisconnect(InstanceVar.GoPointer(), HandlerIdVar)
475 475
476 }476 }
477 477
478-var xSignalHandlerFind func(uintptr, SignalMatchType, uint, glib.Quark, *Closure, uintptr, uintptr) uint32478+var xSignalHandlerFind func(uintptr, SignalMatchType, uint, glib.Quark, *Closure, uintptr, uintptr) uint
479 479
480 // Finds the first signal handler that matches certain selection criteria.480 // Finds the first signal handler that matches certain selection criteria.
481 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType481 // The criteria mask is passed as an OR-ed combination of #GSignalMatchType
482 // flags, and the criteria values are passed as arguments.482 // flags, and the criteria values are passed as arguments.
483 // The match @mask has to be non-0 for successful matches.483 // The match @mask has to be non-0 for successful matches.
484 // If no handler was found, 0 is returned.484 // If no handler was found, 0 is returned.
485-func SignalHandlerFind(InstanceVar *Object, MaskVar SignalMatchType, SignalIdVar uint, DetailVar glib.Quark, ClosureVar *Closure, FuncVar uintptr, DataVar uintptr) uint32 {485+func SignalHandlerFind(InstanceVar *Object, MaskVar SignalMatchType, SignalIdVar uint, DetailVar glib.Quark, ClosureVar *Closure, FuncVar uintptr, DataVar uintptr) uint {
486 486
487 cret := xSignalHandlerFind(InstanceVar.GoPointer(), MaskVar, SignalIdVar, DetailVar, ClosureVar, FuncVar, DataVar)487 cret := xSignalHandlerFind(InstanceVar.GoPointer(), MaskVar, SignalIdVar, DetailVar, ClosureVar, FuncVar, DataVar)
488 488
489 return cret489 return cret
490 }490 }
491 491
492-var xSignalHandlerIsConnected func(uintptr, uint32) bool492+var xSignalHandlerIsConnected func(uintptr, uint) bool
493 493
494 // Returns whether @handler_id is the ID of a handler connected to @instance.494 // Returns whether @handler_id is the ID of a handler connected to @instance.
495-func SignalHandlerIsConnected(InstanceVar *Object, HandlerIdVar uint32) bool {495+func SignalHandlerIsConnected(InstanceVar *Object, HandlerIdVar uint) bool {
496 496
497 cret := xSignalHandlerIsConnected(InstanceVar.GoPointer(), HandlerIdVar)497 cret := xSignalHandlerIsConnected(InstanceVar.GoPointer(), HandlerIdVar)
498 498
499 return cret499 return cret
500 }500 }
501 501
502-var xSignalHandlerUnblock func(uintptr, uint32)502+var xSignalHandlerUnblock func(uintptr, uint)
503 503
504 // Undoes the effect of a previous g_signal_handler_block() call. A504 // Undoes the effect of a previous g_signal_handler_block() call. A
505 // blocked handler is skipped during signal emissions and will not be505 // blocked handler is skipped during signal emissions and will not be
@@ -514,7 +514,7 @@ var xSignalHandlerUnblock func(uintptr, uint32)
514 //514 //
515 // The @handler_id has to be a valid id of a signal handler that is515 // The @handler_id has to be a valid id of a signal handler that is
516 // connected to a signal of @instance and is currently blocked.516 // connected to a signal of @instance and is currently blocked.
517-func SignalHandlerUnblock(InstanceVar *Object, HandlerIdVar uint32) {517+func SignalHandlerUnblock(InstanceVar *Object, HandlerIdVar uint) {
518 518
519 xSignalHandlerUnblock(InstanceVar.GoPointer(), HandlerIdVar)519 xSignalHandlerUnblock(InstanceVar.GoPointer(), HandlerIdVar)
520 520
@@ -917,10 +917,10 @@ func NewSignalQuery(SignalIdVar uint, QueryVar *SignalQuery) {
917 917
918 }918 }
919 919
920-var xSignalRemoveEmissionHook func(uint, uint32)920+var xSignalRemoveEmissionHook func(uint, uint)
921 921
922 // Deletes an emission hook.922 // Deletes an emission hook.
923-func SignalRemoveEmissionHook(SignalIdVar uint, HookIdVar uint32) {923+func SignalRemoveEmissionHook(SignalIdVar uint, HookIdVar uint) {
924 924
925 xSignalRemoveEmissionHook(SignalIdVar, HookIdVar)925 xSignalRemoveEmissionHook(SignalIdVar, HookIdVar)
926 926
M v4/gobject/gsignalgroup.go +14 -6
@@ -300,10 +300,12 @@ func (c *SignalGroup) SetGoPointer(ptr uintptr) {
300 // other than %NULL. It is similar to #GObject::notify on `target` except it300 // other than %NULL. It is similar to #GObject::notify on `target` except it
301 // will not emit when #GSignalGroup:target is %NULL and also allows for301 // will not emit when #GSignalGroup:target is %NULL and also allows for
302 // receiving the #GObject without a data-race.302 // receiving the #GObject without a data-race.
303-func (x *SignalGroup) ConnectBind(cb *func(SignalGroup, uintptr)) uint32 {303+func (x *SignalGroup) ConnectBind(cb *func(SignalGroup, uintptr)) uint {
304 cbPtr := uintptr(unsafe.Pointer(cb))304 cbPtr := uintptr(unsafe.Pointer(cb))
305 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {305 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
306- return SignalConnect(x.GoPointer(), "bind", cbRefPtr)306+ handlerID := SignalConnect(x.GoPointer(), "bind", cbRefPtr)
307+ glib.SaveHandlerMapping(handlerID, cbPtr)
308+ return handlerID
307 }309 }
308 310
309 fcb := func(clsPtr uintptr, InstanceVarp uintptr) {311 fcb := func(clsPtr uintptr, InstanceVarp uintptr) {
@@ -316,7 +318,9 @@ func (x *SignalGroup) ConnectBind(cb *func(SignalGroup, uintptr)) uint32 {
316 }318 }
317 cbRefPtr := purego.NewCallback(fcb)319 cbRefPtr := purego.NewCallback(fcb)
318 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)320 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
319- return SignalConnect(x.GoPointer(), "bind", cbRefPtr)321+ handlerID := SignalConnect(x.GoPointer(), "bind", cbRefPtr)
322+ glib.SaveHandlerMapping(handlerID, cbPtr)
323+ return handlerID
320 }324 }
321 325
322 // This signal is emitted when the target instance of @self is set to a326 // This signal is emitted when the target instance of @self is set to a
@@ -324,10 +328,12 @@ func (x *SignalGroup) ConnectBind(cb *func(SignalGroup, uintptr)) uint32 {
324 //328 //
325 // This signal will only be emitted if the previous target of @self is329 // This signal will only be emitted if the previous target of @self is
326 // non-%NULL.330 // non-%NULL.
327-func (x *SignalGroup) ConnectUnbind(cb *func(SignalGroup)) uint32 {331+func (x *SignalGroup) ConnectUnbind(cb *func(SignalGroup)) uint {
328 cbPtr := uintptr(unsafe.Pointer(cb))332 cbPtr := uintptr(unsafe.Pointer(cb))
329 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {333 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
330- return SignalConnect(x.GoPointer(), "unbind", cbRefPtr)334+ handlerID := SignalConnect(x.GoPointer(), "unbind", cbRefPtr)
335+ glib.SaveHandlerMapping(handlerID, cbPtr)
336+ return handlerID
331 }337 }
332 338
333 fcb := func(clsPtr uintptr) {339 fcb := func(clsPtr uintptr) {
@@ -340,7 +346,9 @@ func (x *SignalGroup) ConnectUnbind(cb *func(SignalGroup)) uint32 {
340 }346 }
341 cbRefPtr := purego.NewCallback(fcb)347 cbRefPtr := purego.NewCallback(fcb)
342 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)348 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
343- return SignalConnect(x.GoPointer(), "unbind", cbRefPtr)349+ handlerID := SignalConnect(x.GoPointer(), "unbind", cbRefPtr)
350+ glib.SaveHandlerMapping(handlerID, cbPtr)
351+ return handlerID
344 }352 }
345 353
346 func init() {354 func init() {
M v4/gobject/gvalue.go +9 -13
@@ -248,10 +248,10 @@ func (x *Value) GetInt64() int64 {
248 return cret248 return cret
249 }249 }
250 250
251-var xValueGetLong func(uintptr) int32251+var xValueGetLong func(uintptr) int
252 252
253 // Get the contents of a %G_TYPE_LONG #GValue.253 // Get the contents of a %G_TYPE_LONG #GValue.
254-func (x *Value) GetLong() int32 {254+func (x *Value) GetLong() int {
255 255
256 cret := xValueGetLong(x.GoPointer())256 cret := xValueGetLong(x.GoPointer())
257 257
@@ -352,10 +352,10 @@ func (x *Value) GetUint64() uint64 {
352 return cret352 return cret
353 }353 }
354 354
355-var xValueGetUlong func(uintptr) uint32355+var xValueGetUlong func(uintptr) uint
356 356
357 // Get the contents of a %G_TYPE_ULONG #GValue.357 // Get the contents of a %G_TYPE_ULONG #GValue.
358-func (x *Value) GetUlong() uint32 {358+func (x *Value) GetUlong() uint {
359 359
360 cret := xValueGetUlong(x.GoPointer())360 cret := xValueGetUlong(x.GoPointer())
361 361
@@ -566,10 +566,10 @@ func (x *Value) SetInternedString(VStringVar *string) {
566 566
567 }567 }
568 568
569-var xValueSetLong func(uintptr, int32)569+var xValueSetLong func(uintptr, int)
570 570
571 // Set the contents of a %G_TYPE_LONG #GValue to @v_long.571 // Set the contents of a %G_TYPE_LONG #GValue to @v_long.
572-func (x *Value) SetLong(VLongVar int32) {572+func (x *Value) SetLong(VLongVar int) {
573 573
574 xValueSetLong(x.GoPointer(), VLongVar)574 xValueSetLong(x.GoPointer(), VLongVar)
575 575
@@ -722,10 +722,10 @@ func (x *Value) SetUint64(VUint64Var uint64) {
722 722
723 }723 }
724 724
725-var xValueSetUlong func(uintptr, uint32)725+var xValueSetUlong func(uintptr, uint)
726 726
727 // Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.727 // Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong.
728-func (x *Value) SetUlong(VUlongVar uint32) {728+func (x *Value) SetUlong(VUlongVar uint) {
729 729
730 xValueSetUlong(x.GoPointer(), VUlongVar)730 xValueSetUlong(x.GoPointer(), VUlongVar)
731 731
@@ -801,11 +801,7 @@ var xValueTakeString func(uintptr, uintptr)
801 // Sets the contents of a %G_TYPE_STRING #GValue to @v_string.801 // Sets the contents of a %G_TYPE_STRING #GValue to @v_string.
802 func (x *Value) TakeString(VStringVar *string) {802 func (x *Value) TakeString(VStringVar *string) {
803 803
804- VStringVarPtr, VStringVarBytes := core.NullableStringToPtr(VStringVar)804+ xValueTakeString(x.GoPointer(), core.GStrdupNullable(VStringVar))
805-
806- xValueTakeString(x.GoPointer(), VStringVarPtr)
807-
808- runtime.KeepAlive(VStringVarBytes)
809 805
810 }806 }
811 807
M v4/gobject/more.go +4 -3
@@ -28,7 +28,7 @@ func IncreaseRef(a uintptr) {
28 xObjectRefSink(a)28 xObjectRefSink(a)
29 }29 }
30 30
31-func SignalConnect(a uintptr, b string, c uintptr) uint32 {31+func SignalConnect(a uintptr, b string, c uintptr) uint {
32 return xSignalConnectData(a, b, c, 0, 0, 0)32 return xSignalConnectData(a, b, c, 0, 0, 0)
33 }33 }
34 34
@@ -36,12 +36,13 @@ func (o Object) Cast(v Ptr) {
36 v.SetGoPointer(o.GoPointer())36 v.SetGoPointer(o.GoPointer())
37 }37 }
38 38
39-func (o Object) ConnectSignal(signal string, cb *func()) uint32 {39+func (o Object) ConnectSignal(signal string, cb *func()) uint {
40 return SignalConnect(o.GoPointer(), signal, glib.NewCallback(cb))40 return SignalConnect(o.GoPointer(), signal, glib.NewCallback(cb))
41 }41 }
42 42
43-func (o Object) DisconnectSignal(handler uint32) {43+func (o Object) DisconnectSignal(handler uint) {
44 SignalHandlerDisconnect(&o, handler)44 SignalHandlerDisconnect(&o, handler)
45+ glib.RemoveCallbackByHandler(handler)
45 }46 }
46 47
47 // types48 // types
M v4/gsk/gskrendernodeimpl.go +2 -2
@@ -822,7 +822,7 @@ func DebugNodeNewFromInternalPtr(ptr uintptr) *DebugNode {
822 return cls822 return cls
823 }823 }
824 824
825-var xNewDebugNode func(uintptr, string) uintptr825+var xNewDebugNode func(uintptr, uintptr) uintptr
826 826
827 // Creates a `GskRenderNode` that will add debug information about827 // Creates a `GskRenderNode` that will add debug information about
828 // the given @child.828 // the given @child.
@@ -831,7 +831,7 @@ var xNewDebugNode func(uintptr, string) uintptr
831 func NewDebugNode(ChildVar *RenderNode, MessageVar string) *DebugNode {831 func NewDebugNode(ChildVar *RenderNode, MessageVar string) *DebugNode {
832 var cls *DebugNode832 var cls *DebugNode
833 833
834- cret := xNewDebugNode(ChildVar.GoPointer(), MessageVar)834+ cret := xNewDebugNode(ChildVar.GoPointer(), core.GStrdup(MessageVar))
835 835
836 if cret == 0 {836 if cret == 0 {
837 return nil837 return nil
M v4/gtk/gtkaboutdialog.go +7 -3
@@ -921,10 +921,12 @@ func (x *AboutDialog) GetPropertyWrapLicense() bool {
921 //921 //
922 // Applications may connect to it to override the default behaviour,922 // Applications may connect to it to override the default behaviour,
923 // which is to call [method@Gtk.FileLauncher.launch].923 // which is to call [method@Gtk.FileLauncher.launch].
924-func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) uint32 {924+func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) uint {
925 cbPtr := uintptr(unsafe.Pointer(cb))925 cbPtr := uintptr(unsafe.Pointer(cb))
926 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {926 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
927- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)927+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
928+ glib.SaveHandlerMapping(handlerID, cbPtr)
929+ return handlerID
928 }930 }
929 931
930 fcb := func(clsPtr uintptr, UriVarp string) bool {932 fcb := func(clsPtr uintptr, UriVarp string) bool {
@@ -937,7 +939,9 @@ func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) ui
937 }939 }
938 cbRefPtr := purego.NewCallback(fcb)940 cbRefPtr := purego.NewCallback(fcb)
939 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)941 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
940- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)942+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
943+ glib.SaveHandlerMapping(handlerID, cbPtr)
944+ return handlerID
941 }945 }
942 946
943 // Requests the user's screen reader to announce the given message.947 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkadjustment.go +14 -6
@@ -543,10 +543,12 @@ func (x *Adjustment) GetPropertyValue() float64 {
543 //543 //
544 // Note that the [property@Gtk.Adjustment:value] property is544 // Note that the [property@Gtk.Adjustment:value] property is
545 // covered by the [signal@Gtk.Adjustment::value-changed] signal.545 // covered by the [signal@Gtk.Adjustment::value-changed] signal.
546-func (x *Adjustment) ConnectChanged(cb *func(Adjustment)) uint32 {546+func (x *Adjustment) ConnectChanged(cb *func(Adjustment)) uint {
547 cbPtr := uintptr(unsafe.Pointer(cb))547 cbPtr := uintptr(unsafe.Pointer(cb))
548 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {548 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
549- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)549+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
550+ glib.SaveHandlerMapping(handlerID, cbPtr)
551+ return handlerID
550 }552 }
551 553
552 fcb := func(clsPtr uintptr) {554 fcb := func(clsPtr uintptr) {
@@ -559,14 +561,18 @@ func (x *Adjustment) ConnectChanged(cb *func(Adjustment)) uint32 {
559 }561 }
560 cbRefPtr := purego.NewCallback(fcb)562 cbRefPtr := purego.NewCallback(fcb)
561 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)563 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
562- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)564+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
565+ glib.SaveHandlerMapping(handlerID, cbPtr)
566+ return handlerID
563 }567 }
564 568
565 // Emitted when the value has been changed.569 // Emitted when the value has been changed.
566-func (x *Adjustment) ConnectValueChanged(cb *func(Adjustment)) uint32 {570+func (x *Adjustment) ConnectValueChanged(cb *func(Adjustment)) uint {
567 cbPtr := uintptr(unsafe.Pointer(cb))571 cbPtr := uintptr(unsafe.Pointer(cb))
568 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {572 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
569- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)573+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
574+ glib.SaveHandlerMapping(handlerID, cbPtr)
575+ return handlerID
570 }576 }
571 577
572 fcb := func(clsPtr uintptr) {578 fcb := func(clsPtr uintptr) {
@@ -579,7 +585,9 @@ func (x *Adjustment) ConnectValueChanged(cb *func(Adjustment)) uint32 {
579 }585 }
580 cbRefPtr := purego.NewCallback(fcb)586 cbRefPtr := purego.NewCallback(fcb)
581 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)587 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
582- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)588+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
589+ glib.SaveHandlerMapping(handlerID, cbPtr)
590+ return handlerID
583 }591 }
584 592
585 func init() {593 func init() {
M v4/gtk/gtkappchooserbutton.go +28 -12
@@ -295,10 +295,12 @@ func (x *AppChooserButton) GetPropertyShowDialogItem() bool {
295 //295 //
296 // The `::activate` signal on `GtkAppChooserButton` is an action signal and296 // The `::activate` signal on `GtkAppChooserButton` is an action signal and
297 // emitting it causes the button to pop up its dialog.297 // emitting it causes the button to pop up its dialog.
298-func (x *AppChooserButton) ConnectActivate(cb *func(AppChooserButton)) uint32 {298+func (x *AppChooserButton) ConnectActivate(cb *func(AppChooserButton)) uint {
299 cbPtr := uintptr(unsafe.Pointer(cb))299 cbPtr := uintptr(unsafe.Pointer(cb))
300 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {300 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
301- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)301+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
302+ glib.SaveHandlerMapping(handlerID, cbPtr)
303+ return handlerID
302 }304 }
303 305
304 fcb := func(clsPtr uintptr) {306 fcb := func(clsPtr uintptr) {
@@ -311,14 +313,18 @@ func (x *AppChooserButton) ConnectActivate(cb *func(AppChooserButton)) uint32 {
311 }313 }
312 cbRefPtr := purego.NewCallback(fcb)314 cbRefPtr := purego.NewCallback(fcb)
313 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)315 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
314- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)316+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
317+ glib.SaveHandlerMapping(handlerID, cbPtr)
318+ return handlerID
315 }319 }
316 320
317 // Emitted when the active application changes.321 // Emitted when the active application changes.
318-func (x *AppChooserButton) ConnectChanged(cb *func(AppChooserButton)) uint32 {322+func (x *AppChooserButton) ConnectChanged(cb *func(AppChooserButton)) uint {
319 cbPtr := uintptr(unsafe.Pointer(cb))323 cbPtr := uintptr(unsafe.Pointer(cb))
320 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {324 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
321- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)325+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
326+ glib.SaveHandlerMapping(handlerID, cbPtr)
327+ return handlerID
322 }328 }
323 329
324 fcb := func(clsPtr uintptr) {330 fcb := func(clsPtr uintptr) {
@@ -331,17 +337,21 @@ func (x *AppChooserButton) ConnectChanged(cb *func(AppChooserButton)) uint32 {
331 }337 }
332 cbRefPtr := purego.NewCallback(fcb)338 cbRefPtr := purego.NewCallback(fcb)
333 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)339 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
334- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)340+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
341+ glib.SaveHandlerMapping(handlerID, cbPtr)
342+ return handlerID
335 }343 }
336 344
337 // Emitted when a custom item is activated.345 // Emitted when a custom item is activated.
338 //346 //
339 // Use [method@Gtk.AppChooserButton.append_custom_item],347 // Use [method@Gtk.AppChooserButton.append_custom_item],
340 // to add custom items.348 // to add custom items.
341-func (x *AppChooserButton) ConnectCustomItemActivated(cb *func(AppChooserButton, string)) uint32 {349+func (x *AppChooserButton) ConnectCustomItemActivated(cb *func(AppChooserButton, string)) uint {
342 cbPtr := uintptr(unsafe.Pointer(cb))350 cbPtr := uintptr(unsafe.Pointer(cb))
343 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {351 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
344- return gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr)352+ handlerID := gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr)
353+ glib.SaveHandlerMapping(handlerID, cbPtr)
354+ return handlerID
345 }355 }
346 356
347 fcb := func(clsPtr uintptr, ItemNameVarp string) {357 fcb := func(clsPtr uintptr, ItemNameVarp string) {
@@ -354,16 +364,20 @@ func (x *AppChooserButton) ConnectCustomItemActivated(cb *func(AppChooserButton,
354 }364 }
355 cbRefPtr := purego.NewCallback(fcb)365 cbRefPtr := purego.NewCallback(fcb)
356 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)366 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
357- return gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr)367+ handlerID := gobject.SignalConnect(x.GoPointer(), "custom-item-activated", cbRefPtr)
368+ glib.SaveHandlerMapping(handlerID, cbPtr)
369+ return handlerID
358 }370 }
359 371
360 // ConnectCustomItemActivatedWithDetail connects to the "custom-item-activated" signal with a detail string.372 // ConnectCustomItemActivatedWithDetail connects to the "custom-item-activated" signal with a detail string.
361 // The detail is appended as "custom-item-activated::<detail>".373 // The detail is appended as "custom-item-activated::<detail>".
362-func (x *AppChooserButton) ConnectCustomItemActivatedWithDetail(detail string, cb *func(AppChooserButton, string)) uint32 {374+func (x *AppChooserButton) ConnectCustomItemActivatedWithDetail(detail string, cb *func(AppChooserButton, string)) uint {
363 cbPtr := uintptr(unsafe.Pointer(cb))375 cbPtr := uintptr(unsafe.Pointer(cb))
364 signalName := fmt.Sprintf("custom-item-activated::%s", detail)376 signalName := fmt.Sprintf("custom-item-activated::%s", detail)
365 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {377 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
366- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)378+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
379+ glib.SaveHandlerMapping(handlerID, cbPtr)
380+ return handlerID
367 }381 }
368 382
369 fcb := func(clsPtr uintptr, ItemNameVarp string) {383 fcb := func(clsPtr uintptr, ItemNameVarp string) {
@@ -376,7 +390,9 @@ func (x *AppChooserButton) ConnectCustomItemActivatedWithDetail(detail string, c
376 }390 }
377 cbRefPtr := purego.NewCallback(fcb)391 cbRefPtr := purego.NewCallback(fcb)
378 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)392 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
379- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)393+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
394+ glib.SaveHandlerMapping(handlerID, cbPtr)
395+ return handlerID
380 }396 }
381 397
382 // Requests the user's screen reader to announce the given message.398 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkappchooserwidget.go +14 -6
@@ -345,10 +345,12 @@ func (x *AppChooserWidget) GetPropertyShowRecommended() bool {
345 // This usually happens when the user double clicks an item, or an item345 // This usually happens when the user double clicks an item, or an item
346 // is selected and the user presses one of the keys Space, Shift+Space,346 // is selected and the user presses one of the keys Space, Shift+Space,
347 // Return or Enter.347 // Return or Enter.
348-func (x *AppChooserWidget) ConnectApplicationActivated(cb *func(AppChooserWidget, uintptr)) uint32 {348+func (x *AppChooserWidget) ConnectApplicationActivated(cb *func(AppChooserWidget, uintptr)) uint {
349 cbPtr := uintptr(unsafe.Pointer(cb))349 cbPtr := uintptr(unsafe.Pointer(cb))
350 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {350 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
351- return gobject.SignalConnect(x.GoPointer(), "application-activated", cbRefPtr)351+ handlerID := gobject.SignalConnect(x.GoPointer(), "application-activated", cbRefPtr)
352+ glib.SaveHandlerMapping(handlerID, cbPtr)
353+ return handlerID
352 }354 }
353 355
354 fcb := func(clsPtr uintptr, ApplicationVarp uintptr) {356 fcb := func(clsPtr uintptr, ApplicationVarp uintptr) {
@@ -361,14 +363,18 @@ func (x *AppChooserWidget) ConnectApplicationActivated(cb *func(AppChooserWidget
361 }363 }
362 cbRefPtr := purego.NewCallback(fcb)364 cbRefPtr := purego.NewCallback(fcb)
363 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)365 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
364- return gobject.SignalConnect(x.GoPointer(), "application-activated", cbRefPtr)366+ handlerID := gobject.SignalConnect(x.GoPointer(), "application-activated", cbRefPtr)
367+ glib.SaveHandlerMapping(handlerID, cbPtr)
368+ return handlerID
365 }369 }
366 370
367 // Emitted when an application item is selected from the widget's list.371 // Emitted when an application item is selected from the widget's list.
368-func (x *AppChooserWidget) ConnectApplicationSelected(cb *func(AppChooserWidget, uintptr)) uint32 {372+func (x *AppChooserWidget) ConnectApplicationSelected(cb *func(AppChooserWidget, uintptr)) uint {
369 cbPtr := uintptr(unsafe.Pointer(cb))373 cbPtr := uintptr(unsafe.Pointer(cb))
370 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {374 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
371- return gobject.SignalConnect(x.GoPointer(), "application-selected", cbRefPtr)375+ handlerID := gobject.SignalConnect(x.GoPointer(), "application-selected", cbRefPtr)
376+ glib.SaveHandlerMapping(handlerID, cbPtr)
377+ return handlerID
372 }378 }
373 379
374 fcb := func(clsPtr uintptr, ApplicationVarp uintptr) {380 fcb := func(clsPtr uintptr, ApplicationVarp uintptr) {
@@ -381,7 +387,9 @@ func (x *AppChooserWidget) ConnectApplicationSelected(cb *func(AppChooserWidget,
381 }387 }
382 cbRefPtr := purego.NewCallback(fcb)388 cbRefPtr := purego.NewCallback(fcb)
383 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)389 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
384- return gobject.SignalConnect(x.GoPointer(), "application-selected", cbRefPtr)390+ handlerID := gobject.SignalConnect(x.GoPointer(), "application-selected", cbRefPtr)
391+ glib.SaveHandlerMapping(handlerID, cbPtr)
392+ return handlerID
385 }393 }
386 394
387 // Requests the user's screen reader to announce the given message.395 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkapplication.go +21 -9
@@ -570,10 +570,12 @@ func (x *Application) GetPropertyScreensaverActive() bool {
570 // Applications can connect to this signal and call570 // Applications can connect to this signal and call
571 // [method@Gtk.Application.inhibit] with [flags@Gtk.ApplicationInhibitFlags.logout]571 // [method@Gtk.Application.inhibit] with [flags@Gtk.ApplicationInhibitFlags.logout]
572 // to delay the end of the session until state has been saved.572 // to delay the end of the session until state has been saved.
573-func (x *Application) ConnectQueryEnd(cb *func(Application)) uint32 {573+func (x *Application) ConnectQueryEnd(cb *func(Application)) uint {
574 cbPtr := uintptr(unsafe.Pointer(cb))574 cbPtr := uintptr(unsafe.Pointer(cb))
575 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {575 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
576- return gobject.SignalConnect(x.GoPointer(), "query-end", cbRefPtr)576+ handlerID := gobject.SignalConnect(x.GoPointer(), "query-end", cbRefPtr)
577+ glib.SaveHandlerMapping(handlerID, cbPtr)
578+ return handlerID
577 }579 }
578 580
579 fcb := func(clsPtr uintptr) {581 fcb := func(clsPtr uintptr) {
@@ -586,16 +588,20 @@ func (x *Application) ConnectQueryEnd(cb *func(Application)) uint32 {
586 }588 }
587 cbRefPtr := purego.NewCallback(fcb)589 cbRefPtr := purego.NewCallback(fcb)
588 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)590 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
589- return gobject.SignalConnect(x.GoPointer(), "query-end", cbRefPtr)591+ handlerID := gobject.SignalConnect(x.GoPointer(), "query-end", cbRefPtr)
592+ glib.SaveHandlerMapping(handlerID, cbPtr)
593+ return handlerID
590 }594 }
591 595
592 // Emitted when a window is added to an application.596 // Emitted when a window is added to an application.
593 //597 //
594 // See [method@Gtk.Application.add_window].598 // See [method@Gtk.Application.add_window].
595-func (x *Application) ConnectWindowAdded(cb *func(Application, uintptr)) uint32 {599+func (x *Application) ConnectWindowAdded(cb *func(Application, uintptr)) uint {
596 cbPtr := uintptr(unsafe.Pointer(cb))600 cbPtr := uintptr(unsafe.Pointer(cb))
597 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {601 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
598- return gobject.SignalConnect(x.GoPointer(), "window-added", cbRefPtr)602+ handlerID := gobject.SignalConnect(x.GoPointer(), "window-added", cbRefPtr)
603+ glib.SaveHandlerMapping(handlerID, cbPtr)
604+ return handlerID
599 }605 }
600 606
601 fcb := func(clsPtr uintptr, WindowVarp uintptr) {607 fcb := func(clsPtr uintptr, WindowVarp uintptr) {
@@ -608,17 +614,21 @@ func (x *Application) ConnectWindowAdded(cb *func(Application, uintptr)) uint32
608 }614 }
609 cbRefPtr := purego.NewCallback(fcb)615 cbRefPtr := purego.NewCallback(fcb)
610 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)616 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
611- return gobject.SignalConnect(x.GoPointer(), "window-added", cbRefPtr)617+ handlerID := gobject.SignalConnect(x.GoPointer(), "window-added", cbRefPtr)
618+ glib.SaveHandlerMapping(handlerID, cbPtr)
619+ return handlerID
612 }620 }
613 621
614 // Emitted when a window is removed from an application.622 // Emitted when a window is removed from an application.
615 //623 //
616 // This can happen as a side-effect of the window being destroyed624 // This can happen as a side-effect of the window being destroyed
617 // or explicitly through [method@Gtk.Application.remove_window].625 // or explicitly through [method@Gtk.Application.remove_window].
618-func (x *Application) ConnectWindowRemoved(cb *func(Application, uintptr)) uint32 {626+func (x *Application) ConnectWindowRemoved(cb *func(Application, uintptr)) uint {
619 cbPtr := uintptr(unsafe.Pointer(cb))627 cbPtr := uintptr(unsafe.Pointer(cb))
620 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {628 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
621- return gobject.SignalConnect(x.GoPointer(), "window-removed", cbRefPtr)629+ handlerID := gobject.SignalConnect(x.GoPointer(), "window-removed", cbRefPtr)
630+ glib.SaveHandlerMapping(handlerID, cbPtr)
631+ return handlerID
622 }632 }
623 633
624 fcb := func(clsPtr uintptr, WindowVarp uintptr) {634 fcb := func(clsPtr uintptr, WindowVarp uintptr) {
@@ -631,7 +641,9 @@ func (x *Application) ConnectWindowRemoved(cb *func(Application, uintptr)) uint3
631 }641 }
632 cbRefPtr := purego.NewCallback(fcb)642 cbRefPtr := purego.NewCallback(fcb)
633 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)643 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
634- return gobject.SignalConnect(x.GoPointer(), "window-removed", cbRefPtr)644+ handlerID := gobject.SignalConnect(x.GoPointer(), "window-removed", cbRefPtr)
645+ glib.SaveHandlerMapping(handlerID, cbPtr)
646+ return handlerID
635 }647 }
636 648
637 // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group.649 // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group.
M v4/gtk/gtkassistant.go +35 -15
@@ -501,10 +501,12 @@ func (x *Assistant) GetPropertyUseHeaderBar() int {
501 // %GTK_ASSISTANT_PAGE_PROGRESS after the confirmation page and handle501 // %GTK_ASSISTANT_PAGE_PROGRESS after the confirmation page and handle
502 // this operation within the [signal@Gtk.Assistant::prepare] signal of502 // this operation within the [signal@Gtk.Assistant::prepare] signal of
503 // the progress page.503 // the progress page.
504-func (x *Assistant) ConnectApply(cb *func(Assistant)) uint32 {504+func (x *Assistant) ConnectApply(cb *func(Assistant)) uint {
505 cbPtr := uintptr(unsafe.Pointer(cb))505 cbPtr := uintptr(unsafe.Pointer(cb))
506 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {506 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
507- return gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)507+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
508+ glib.SaveHandlerMapping(handlerID, cbPtr)
509+ return handlerID
508 }510 }
509 511
510 fcb := func(clsPtr uintptr) {512 fcb := func(clsPtr uintptr) {
@@ -517,14 +519,18 @@ func (x *Assistant) ConnectApply(cb *func(Assistant)) uint32 {
517 }519 }
518 cbRefPtr := purego.NewCallback(fcb)520 cbRefPtr := purego.NewCallback(fcb)
519 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)521 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
520- return gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)522+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply", cbRefPtr)
523+ glib.SaveHandlerMapping(handlerID, cbPtr)
524+ return handlerID
521 }525 }
522 526
523 // Emitted when then the cancel button is clicked.527 // Emitted when then the cancel button is clicked.
524-func (x *Assistant) ConnectCancel(cb *func(Assistant)) uint32 {528+func (x *Assistant) ConnectCancel(cb *func(Assistant)) uint {
525 cbPtr := uintptr(unsafe.Pointer(cb))529 cbPtr := uintptr(unsafe.Pointer(cb))
526 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {530 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
527- return gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)531+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
532+ glib.SaveHandlerMapping(handlerID, cbPtr)
533+ return handlerID
528 }534 }
529 535
530 fcb := func(clsPtr uintptr) {536 fcb := func(clsPtr uintptr) {
@@ -537,16 +543,20 @@ func (x *Assistant) ConnectCancel(cb *func(Assistant)) uint32 {
537 }543 }
538 cbRefPtr := purego.NewCallback(fcb)544 cbRefPtr := purego.NewCallback(fcb)
539 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)545 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
540- return gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)546+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
547+ glib.SaveHandlerMapping(handlerID, cbPtr)
548+ return handlerID
541 }549 }
542 550
543 // Emitted either when the close button of a summary page is clicked,551 // Emitted either when the close button of a summary page is clicked,
544 // or when the apply button in the last page in the flow (of type552 // or when the apply button in the last page in the flow (of type
545 // %GTK_ASSISTANT_PAGE_CONFIRM) is clicked.553 // %GTK_ASSISTANT_PAGE_CONFIRM) is clicked.
546-func (x *Assistant) ConnectClose(cb *func(Assistant)) uint32 {554+func (x *Assistant) ConnectClose(cb *func(Assistant)) uint {
547 cbPtr := uintptr(unsafe.Pointer(cb))555 cbPtr := uintptr(unsafe.Pointer(cb))
548 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {556 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
549- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)557+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
558+ glib.SaveHandlerMapping(handlerID, cbPtr)
559+ return handlerID
550 }560 }
551 561
552 fcb := func(clsPtr uintptr) {562 fcb := func(clsPtr uintptr) {
@@ -559,14 +569,18 @@ func (x *Assistant) ConnectClose(cb *func(Assistant)) uint32 {
559 }569 }
560 cbRefPtr := purego.NewCallback(fcb)570 cbRefPtr := purego.NewCallback(fcb)
561 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)571 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
562- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)572+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
573+ glib.SaveHandlerMapping(handlerID, cbPtr)
574+ return handlerID
563 }575 }
564 576
565 // The action signal for the Escape binding.577 // The action signal for the Escape binding.
566-func (x *Assistant) ConnectEscape(cb *func(Assistant)) uint32 {578+func (x *Assistant) ConnectEscape(cb *func(Assistant)) uint {
567 cbPtr := uintptr(unsafe.Pointer(cb))579 cbPtr := uintptr(unsafe.Pointer(cb))
568 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {580 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
569- return gobject.SignalConnect(x.GoPointer(), "escape", cbRefPtr)581+ handlerID := gobject.SignalConnect(x.GoPointer(), "escape", cbRefPtr)
582+ glib.SaveHandlerMapping(handlerID, cbPtr)
583+ return handlerID
570 }584 }
571 585
572 fcb := func(clsPtr uintptr) {586 fcb := func(clsPtr uintptr) {
@@ -579,7 +593,9 @@ func (x *Assistant) ConnectEscape(cb *func(Assistant)) uint32 {
579 }593 }
580 cbRefPtr := purego.NewCallback(fcb)594 cbRefPtr := purego.NewCallback(fcb)
581 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)595 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
582- return gobject.SignalConnect(x.GoPointer(), "escape", cbRefPtr)596+ handlerID := gobject.SignalConnect(x.GoPointer(), "escape", cbRefPtr)
597+ glib.SaveHandlerMapping(handlerID, cbPtr)
598+ return handlerID
583 }599 }
584 600
585 // Emitted when a new page is set as the assistant's current page,601 // Emitted when a new page is set as the assistant's current page,
@@ -587,10 +603,12 @@ func (x *Assistant) ConnectEscape(cb *func(Assistant)) uint32 {
587 //603 //
588 // A handler for this signal can do any preparations which are604 // A handler for this signal can do any preparations which are
589 // necessary before showing @page.605 // necessary before showing @page.
590-func (x *Assistant) ConnectPrepare(cb *func(Assistant, uintptr)) uint32 {606+func (x *Assistant) ConnectPrepare(cb *func(Assistant, uintptr)) uint {
591 cbPtr := uintptr(unsafe.Pointer(cb))607 cbPtr := uintptr(unsafe.Pointer(cb))
592 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {608 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
593- return gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)609+ handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
610+ glib.SaveHandlerMapping(handlerID, cbPtr)
611+ return handlerID
594 }612 }
595 613
596 fcb := func(clsPtr uintptr, PageVarp uintptr) {614 fcb := func(clsPtr uintptr, PageVarp uintptr) {
@@ -603,7 +621,9 @@ func (x *Assistant) ConnectPrepare(cb *func(Assistant, uintptr)) uint32 {
603 }621 }
604 cbRefPtr := purego.NewCallback(fcb)622 cbRefPtr := purego.NewCallback(fcb)
605 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)623 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
606- return gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)624+ handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
625+ glib.SaveHandlerMapping(handlerID, cbPtr)
626+ return handlerID
607 }627 }
608 628
609 // Requests the user's screen reader to announce the given message.629 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkatcontext.go +7 -3
@@ -102,10 +102,12 @@ func (c *ATContext) SetGoPointer(ptr uintptr) {
102 102
103 // Emitted when the attributes of the accessible for the103 // Emitted when the attributes of the accessible for the
104 // `GtkATContext` instance change.104 // `GtkATContext` instance change.
105-func (x *ATContext) ConnectStateChange(cb *func(ATContext)) uint32 {105+func (x *ATContext) ConnectStateChange(cb *func(ATContext)) uint {
106 cbPtr := uintptr(unsafe.Pointer(cb))106 cbPtr := uintptr(unsafe.Pointer(cb))
107 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {107 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
108- return gobject.SignalConnect(x.GoPointer(), "state-change", cbRefPtr)108+ handlerID := gobject.SignalConnect(x.GoPointer(), "state-change", cbRefPtr)
109+ glib.SaveHandlerMapping(handlerID, cbPtr)
110+ return handlerID
109 }111 }
110 112
111 fcb := func(clsPtr uintptr) {113 fcb := func(clsPtr uintptr) {
@@ -118,7 +120,9 @@ func (x *ATContext) ConnectStateChange(cb *func(ATContext)) uint32 {
118 }120 }
119 cbRefPtr := purego.NewCallback(fcb)121 cbRefPtr := purego.NewCallback(fcb)
120 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)122 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
121- return gobject.SignalConnect(x.GoPointer(), "state-change", cbRefPtr)123+ handlerID := gobject.SignalConnect(x.GoPointer(), "state-change", cbRefPtr)
124+ glib.SaveHandlerMapping(handlerID, cbPtr)
125+ return handlerID
122 }126 }
123 127
124 func init() {128 func init() {
M v4/gtk/gtkbutton.go +14 -6
@@ -499,10 +499,12 @@ func (x *Button) GetPropertyUseUnderline() bool {
499 //499 //
500 // The default bindings for this signal are all forms of the500 // The default bindings for this signal are all forms of the
501 // &lt;kbd&gt;␣&lt;/kbd&gt; and &lt;kbd&gt;Enter&lt;/kbd&gt; keys.501 // &lt;kbd&gt;␣&lt;/kbd&gt; and &lt;kbd&gt;Enter&lt;/kbd&gt; keys.
502-func (x *Button) ConnectActivate(cb *func(Button)) uint32 {502+func (x *Button) ConnectActivate(cb *func(Button)) uint {
503 cbPtr := uintptr(unsafe.Pointer(cb))503 cbPtr := uintptr(unsafe.Pointer(cb))
504 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {504 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
505- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)505+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
506+ glib.SaveHandlerMapping(handlerID, cbPtr)
507+ return handlerID
506 }508 }
507 509
508 fcb := func(clsPtr uintptr) {510 fcb := func(clsPtr uintptr) {
@@ -515,14 +517,18 @@ func (x *Button) ConnectActivate(cb *func(Button)) uint32 {
515 }517 }
516 cbRefPtr := purego.NewCallback(fcb)518 cbRefPtr := purego.NewCallback(fcb)
517 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)519 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
518- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)520+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
521+ glib.SaveHandlerMapping(handlerID, cbPtr)
522+ return handlerID
519 }523 }
520 524
521 // Emitted when the button has been activated (pressed and released).525 // Emitted when the button has been activated (pressed and released).
522-func (x *Button) ConnectClicked(cb *func(Button)) uint32 {526+func (x *Button) ConnectClicked(cb *func(Button)) uint {
523 cbPtr := uintptr(unsafe.Pointer(cb))527 cbPtr := uintptr(unsafe.Pointer(cb))
524 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {528 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
525- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)529+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
530+ glib.SaveHandlerMapping(handlerID, cbPtr)
531+ return handlerID
526 }532 }
527 533
528 fcb := func(clsPtr uintptr) {534 fcb := func(clsPtr uintptr) {
@@ -535,7 +541,9 @@ func (x *Button) ConnectClicked(cb *func(Button)) uint32 {
535 }541 }
536 cbRefPtr := purego.NewCallback(fcb)542 cbRefPtr := purego.NewCallback(fcb)
537 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)543 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
538- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)544+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
545+ glib.SaveHandlerMapping(handlerID, cbPtr)
546+ return handlerID
539 }547 }
540 548
541 // Requests the user's screen reader to announce the given message.549 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcalendar.go +35 -15
@@ -452,10 +452,12 @@ func (x *Calendar) GetPropertyYear() int {
452 }452 }
453 453
454 // Emitted when the user selects a day.454 // Emitted when the user selects a day.
455-func (x *Calendar) ConnectDaySelected(cb *func(Calendar)) uint32 {455+func (x *Calendar) ConnectDaySelected(cb *func(Calendar)) uint {
456 cbPtr := uintptr(unsafe.Pointer(cb))456 cbPtr := uintptr(unsafe.Pointer(cb))
457 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {457 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
458- return gobject.SignalConnect(x.GoPointer(), "day-selected", cbRefPtr)458+ handlerID := gobject.SignalConnect(x.GoPointer(), "day-selected", cbRefPtr)
459+ glib.SaveHandlerMapping(handlerID, cbPtr)
460+ return handlerID
459 }461 }
460 462
461 fcb := func(clsPtr uintptr) {463 fcb := func(clsPtr uintptr) {
@@ -468,14 +470,18 @@ func (x *Calendar) ConnectDaySelected(cb *func(Calendar)) uint32 {
468 }470 }
469 cbRefPtr := purego.NewCallback(fcb)471 cbRefPtr := purego.NewCallback(fcb)
470 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)472 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
471- return gobject.SignalConnect(x.GoPointer(), "day-selected", cbRefPtr)473+ handlerID := gobject.SignalConnect(x.GoPointer(), "day-selected", cbRefPtr)
474+ glib.SaveHandlerMapping(handlerID, cbPtr)
475+ return handlerID
472 }476 }
473 477
474 // Emitted when the user switches to the next month.478 // Emitted when the user switches to the next month.
475-func (x *Calendar) ConnectNextMonth(cb *func(Calendar)) uint32 {479+func (x *Calendar) ConnectNextMonth(cb *func(Calendar)) uint {
476 cbPtr := uintptr(unsafe.Pointer(cb))480 cbPtr := uintptr(unsafe.Pointer(cb))
477 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {481 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
478- return gobject.SignalConnect(x.GoPointer(), "next-month", cbRefPtr)482+ handlerID := gobject.SignalConnect(x.GoPointer(), "next-month", cbRefPtr)
483+ glib.SaveHandlerMapping(handlerID, cbPtr)
484+ return handlerID
479 }485 }
480 486
481 fcb := func(clsPtr uintptr) {487 fcb := func(clsPtr uintptr) {
@@ -488,14 +494,18 @@ func (x *Calendar) ConnectNextMonth(cb *func(Calendar)) uint32 {
488 }494 }
489 cbRefPtr := purego.NewCallback(fcb)495 cbRefPtr := purego.NewCallback(fcb)
490 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)496 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
491- return gobject.SignalConnect(x.GoPointer(), "next-month", cbRefPtr)497+ handlerID := gobject.SignalConnect(x.GoPointer(), "next-month", cbRefPtr)
498+ glib.SaveHandlerMapping(handlerID, cbPtr)
499+ return handlerID
492 }500 }
493 501
494 // Emitted when user switches to the next year.502 // Emitted when user switches to the next year.
495-func (x *Calendar) ConnectNextYear(cb *func(Calendar)) uint32 {503+func (x *Calendar) ConnectNextYear(cb *func(Calendar)) uint {
496 cbPtr := uintptr(unsafe.Pointer(cb))504 cbPtr := uintptr(unsafe.Pointer(cb))
497 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {505 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
498- return gobject.SignalConnect(x.GoPointer(), "next-year", cbRefPtr)506+ handlerID := gobject.SignalConnect(x.GoPointer(), "next-year", cbRefPtr)
507+ glib.SaveHandlerMapping(handlerID, cbPtr)
508+ return handlerID
499 }509 }
500 510
501 fcb := func(clsPtr uintptr) {511 fcb := func(clsPtr uintptr) {
@@ -508,14 +518,18 @@ func (x *Calendar) ConnectNextYear(cb *func(Calendar)) uint32 {
508 }518 }
509 cbRefPtr := purego.NewCallback(fcb)519 cbRefPtr := purego.NewCallback(fcb)
510 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)520 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
511- return gobject.SignalConnect(x.GoPointer(), "next-year", cbRefPtr)521+ handlerID := gobject.SignalConnect(x.GoPointer(), "next-year", cbRefPtr)
522+ glib.SaveHandlerMapping(handlerID, cbPtr)
523+ return handlerID
512 }524 }
513 525
514 // Emitted when the user switches to the previous month.526 // Emitted when the user switches to the previous month.
515-func (x *Calendar) ConnectPrevMonth(cb *func(Calendar)) uint32 {527+func (x *Calendar) ConnectPrevMonth(cb *func(Calendar)) uint {
516 cbPtr := uintptr(unsafe.Pointer(cb))528 cbPtr := uintptr(unsafe.Pointer(cb))
517 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {529 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
518- return gobject.SignalConnect(x.GoPointer(), "prev-month", cbRefPtr)530+ handlerID := gobject.SignalConnect(x.GoPointer(), "prev-month", cbRefPtr)
531+ glib.SaveHandlerMapping(handlerID, cbPtr)
532+ return handlerID
519 }533 }
520 534
521 fcb := func(clsPtr uintptr) {535 fcb := func(clsPtr uintptr) {
@@ -528,14 +542,18 @@ func (x *Calendar) ConnectPrevMonth(cb *func(Calendar)) uint32 {
528 }542 }
529 cbRefPtr := purego.NewCallback(fcb)543 cbRefPtr := purego.NewCallback(fcb)
530 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)544 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
531- return gobject.SignalConnect(x.GoPointer(), "prev-month", cbRefPtr)545+ handlerID := gobject.SignalConnect(x.GoPointer(), "prev-month", cbRefPtr)
546+ glib.SaveHandlerMapping(handlerID, cbPtr)
547+ return handlerID
532 }548 }
533 549
534 // Emitted when user switches to the previous year.550 // Emitted when user switches to the previous year.
535-func (x *Calendar) ConnectPrevYear(cb *func(Calendar)) uint32 {551+func (x *Calendar) ConnectPrevYear(cb *func(Calendar)) uint {
536 cbPtr := uintptr(unsafe.Pointer(cb))552 cbPtr := uintptr(unsafe.Pointer(cb))
537 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {553 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
538- return gobject.SignalConnect(x.GoPointer(), "prev-year", cbRefPtr)554+ handlerID := gobject.SignalConnect(x.GoPointer(), "prev-year", cbRefPtr)
555+ glib.SaveHandlerMapping(handlerID, cbPtr)
556+ return handlerID
539 }557 }
540 558
541 fcb := func(clsPtr uintptr) {559 fcb := func(clsPtr uintptr) {
@@ -548,7 +566,9 @@ func (x *Calendar) ConnectPrevYear(cb *func(Calendar)) uint32 {
548 }566 }
549 cbRefPtr := purego.NewCallback(fcb)567 cbRefPtr := purego.NewCallback(fcb)
550 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)568 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
551- return gobject.SignalConnect(x.GoPointer(), "prev-year", cbRefPtr)569+ handlerID := gobject.SignalConnect(x.GoPointer(), "prev-year", cbRefPtr)
570+ glib.SaveHandlerMapping(handlerID, cbPtr)
571+ return handlerID
552 }572 }
553 573
554 // Requests the user's screen reader to announce the given message.574 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcellarea.go +28 -12
@@ -1690,10 +1690,12 @@ func (c *CellArea) SetGoPointer(ptr uintptr) {
1690 1690
1691 // Indicates that editing has started on @renderer and that @editable1691 // Indicates that editing has started on @renderer and that @editable
1692 // should be added to the owning cell-layouting widget at @cell_area.1692 // should be added to the owning cell-layouting widget at @cell_area.
1693-func (x *CellArea) ConnectAddEditable(cb *func(CellArea, uintptr, uintptr, uintptr, string)) uint32 {1693+func (x *CellArea) ConnectAddEditable(cb *func(CellArea, uintptr, uintptr, uintptr, string)) uint {
1694 cbPtr := uintptr(unsafe.Pointer(cb))1694 cbPtr := uintptr(unsafe.Pointer(cb))
1695 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1695 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1696- return gobject.SignalConnect(x.GoPointer(), "add-editable", cbRefPtr)1696+ handlerID := gobject.SignalConnect(x.GoPointer(), "add-editable", cbRefPtr)
1697+ glib.SaveHandlerMapping(handlerID, cbPtr)
1698+ return handlerID
1697 }1699 }
1698 1700
1699 fcb := func(clsPtr uintptr, RendererVarp uintptr, EditableVarp uintptr, CellAreaVarp uintptr, PathVarp string) {1701 fcb := func(clsPtr uintptr, RendererVarp uintptr, EditableVarp uintptr, CellAreaVarp uintptr, PathVarp string) {
@@ -1706,14 +1708,18 @@ func (x *CellArea) ConnectAddEditable(cb *func(CellArea, uintptr, uintptr, uintp
1706 }1708 }
1707 cbRefPtr := purego.NewCallback(fcb)1709 cbRefPtr := purego.NewCallback(fcb)
1708 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1710 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1709- return gobject.SignalConnect(x.GoPointer(), "add-editable", cbRefPtr)1711+ handlerID := gobject.SignalConnect(x.GoPointer(), "add-editable", cbRefPtr)
1712+ glib.SaveHandlerMapping(handlerID, cbPtr)
1713+ return handlerID
1710 }1714 }
1711 1715
1712 // This signal is emitted whenever applying attributes to @area from @model1716 // This signal is emitted whenever applying attributes to @area from @model
1713-func (x *CellArea) ConnectApplyAttributes(cb *func(CellArea, uintptr, uintptr, bool, bool)) uint32 {1717+func (x *CellArea) ConnectApplyAttributes(cb *func(CellArea, uintptr, uintptr, bool, bool)) uint {
1714 cbPtr := uintptr(unsafe.Pointer(cb))1718 cbPtr := uintptr(unsafe.Pointer(cb))
1715 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1719 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1716- return gobject.SignalConnect(x.GoPointer(), "apply-attributes", cbRefPtr)1720+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply-attributes", cbRefPtr)
1721+ glib.SaveHandlerMapping(handlerID, cbPtr)
1722+ return handlerID
1717 }1723 }
1718 1724
1719 fcb := func(clsPtr uintptr, ModelVarp uintptr, IterVarp uintptr, IsExpanderVarp bool, IsExpandedVarp bool) {1725 fcb := func(clsPtr uintptr, ModelVarp uintptr, IterVarp uintptr, IsExpanderVarp bool, IsExpandedVarp bool) {
@@ -1726,7 +1732,9 @@ func (x *CellArea) ConnectApplyAttributes(cb *func(CellArea, uintptr, uintptr, b
1726 }1732 }
1727 cbRefPtr := purego.NewCallback(fcb)1733 cbRefPtr := purego.NewCallback(fcb)
1728 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1734 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1729- return gobject.SignalConnect(x.GoPointer(), "apply-attributes", cbRefPtr)1735+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply-attributes", cbRefPtr)
1736+ glib.SaveHandlerMapping(handlerID, cbPtr)
1737+ return handlerID
1730 }1738 }
1731 1739
1732 // Indicates that focus changed on this @area. This signal1740 // Indicates that focus changed on this @area. This signal
@@ -1737,10 +1745,12 @@ func (x *CellArea) ConnectApplyAttributes(cb *func(CellArea, uintptr, uintptr, b
1737 // currently focused renderer did not change, this is1745 // currently focused renderer did not change, this is
1738 // because focus may change to the same renderer in the1746 // because focus may change to the same renderer in the
1739 // same cell area for a different row of data.1747 // same cell area for a different row of data.
1740-func (x *CellArea) ConnectFocusChanged(cb *func(CellArea, uintptr, string)) uint32 {1748+func (x *CellArea) ConnectFocusChanged(cb *func(CellArea, uintptr, string)) uint {
1741 cbPtr := uintptr(unsafe.Pointer(cb))1749 cbPtr := uintptr(unsafe.Pointer(cb))
1742 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1750 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1743- return gobject.SignalConnect(x.GoPointer(), "focus-changed", cbRefPtr)1751+ handlerID := gobject.SignalConnect(x.GoPointer(), "focus-changed", cbRefPtr)
1752+ glib.SaveHandlerMapping(handlerID, cbPtr)
1753+ return handlerID
1744 }1754 }
1745 1755
1746 fcb := func(clsPtr uintptr, RendererVarp uintptr, PathVarp string) {1756 fcb := func(clsPtr uintptr, RendererVarp uintptr, PathVarp string) {
@@ -1753,15 +1763,19 @@ func (x *CellArea) ConnectFocusChanged(cb *func(CellArea, uintptr, string)) uint
1753 }1763 }
1754 cbRefPtr := purego.NewCallback(fcb)1764 cbRefPtr := purego.NewCallback(fcb)
1755 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1765 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1756- return gobject.SignalConnect(x.GoPointer(), "focus-changed", cbRefPtr)1766+ handlerID := gobject.SignalConnect(x.GoPointer(), "focus-changed", cbRefPtr)
1767+ glib.SaveHandlerMapping(handlerID, cbPtr)
1768+ return handlerID
1757 }1769 }
1758 1770
1759 // Indicates that editing finished on @renderer and that @editable1771 // Indicates that editing finished on @renderer and that @editable
1760 // should be removed from the owning cell-layouting widget.1772 // should be removed from the owning cell-layouting widget.
1761-func (x *CellArea) ConnectRemoveEditable(cb *func(CellArea, uintptr, uintptr)) uint32 {1773+func (x *CellArea) ConnectRemoveEditable(cb *func(CellArea, uintptr, uintptr)) uint {
1762 cbPtr := uintptr(unsafe.Pointer(cb))1774 cbPtr := uintptr(unsafe.Pointer(cb))
1763 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1775 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1764- return gobject.SignalConnect(x.GoPointer(), "remove-editable", cbRefPtr)1776+ handlerID := gobject.SignalConnect(x.GoPointer(), "remove-editable", cbRefPtr)
1777+ glib.SaveHandlerMapping(handlerID, cbPtr)
1778+ return handlerID
1765 }1779 }
1766 1780
1767 fcb := func(clsPtr uintptr, RendererVarp uintptr, EditableVarp uintptr) {1781 fcb := func(clsPtr uintptr, RendererVarp uintptr, EditableVarp uintptr) {
@@ -1774,7 +1788,9 @@ func (x *CellArea) ConnectRemoveEditable(cb *func(CellArea, uintptr, uintptr)) u
1774 }1788 }
1775 cbRefPtr := purego.NewCallback(fcb)1789 cbRefPtr := purego.NewCallback(fcb)
1776 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1790 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1777- return gobject.SignalConnect(x.GoPointer(), "remove-editable", cbRefPtr)1791+ handlerID := gobject.SignalConnect(x.GoPointer(), "remove-editable", cbRefPtr)
1792+ glib.SaveHandlerMapping(handlerID, cbPtr)
1793+ return handlerID
1778 }1794 }
1779 1795
1780 // Gets the ID of the @buildable object.1796 // Gets the ID of the @buildable object.
M v4/gtk/gtkcellrenderer.go +14 -6
@@ -949,10 +949,12 @@ func (x *CellRenderer) GetPropertyYpad() uint {
949 // editing when the user presses Escape.949 // editing when the user presses Escape.
950 //950 //
951 // See also: gtk_cell_renderer_stop_editing().951 // See also: gtk_cell_renderer_stop_editing().
952-func (x *CellRenderer) ConnectEditingCanceled(cb *func(CellRenderer)) uint32 {952+func (x *CellRenderer) ConnectEditingCanceled(cb *func(CellRenderer)) uint {
953 cbPtr := uintptr(unsafe.Pointer(cb))953 cbPtr := uintptr(unsafe.Pointer(cb))
954 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {954 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
955- return gobject.SignalConnect(x.GoPointer(), "editing-canceled", cbRefPtr)955+ handlerID := gobject.SignalConnect(x.GoPointer(), "editing-canceled", cbRefPtr)
956+ glib.SaveHandlerMapping(handlerID, cbPtr)
957+ return handlerID
956 }958 }
957 959
958 fcb := func(clsPtr uintptr) {960 fcb := func(clsPtr uintptr) {
@@ -965,7 +967,9 @@ func (x *CellRenderer) ConnectEditingCanceled(cb *func(CellRenderer)) uint32 {
965 }967 }
966 cbRefPtr := purego.NewCallback(fcb)968 cbRefPtr := purego.NewCallback(fcb)
967 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)969 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
968- return gobject.SignalConnect(x.GoPointer(), "editing-canceled", cbRefPtr)970+ handlerID := gobject.SignalConnect(x.GoPointer(), "editing-canceled", cbRefPtr)
971+ glib.SaveHandlerMapping(handlerID, cbPtr)
972+ return handlerID
969 }973 }
970 974
971 // This signal gets emitted when a cell starts to be edited.975 // This signal gets emitted when a cell starts to be edited.
@@ -1001,10 +1005,12 @@ func (x *CellRenderer) ConnectEditingCanceled(cb *func(CellRenderer)) uint32 {
1001 // }1005 // }
1002 //1006 //
1003 // ```1007 // ```
1004-func (x *CellRenderer) ConnectEditingStarted(cb *func(CellRenderer, uintptr, string)) uint32 {1008+func (x *CellRenderer) ConnectEditingStarted(cb *func(CellRenderer, uintptr, string)) uint {
1005 cbPtr := uintptr(unsafe.Pointer(cb))1009 cbPtr := uintptr(unsafe.Pointer(cb))
1006 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1010 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1007- return gobject.SignalConnect(x.GoPointer(), "editing-started", cbRefPtr)1011+ handlerID := gobject.SignalConnect(x.GoPointer(), "editing-started", cbRefPtr)
1012+ glib.SaveHandlerMapping(handlerID, cbPtr)
1013+ return handlerID
1008 }1014 }
1009 1015
1010 fcb := func(clsPtr uintptr, EditableVarp uintptr, PathVarp string) {1016 fcb := func(clsPtr uintptr, EditableVarp uintptr, PathVarp string) {
@@ -1017,7 +1023,9 @@ func (x *CellRenderer) ConnectEditingStarted(cb *func(CellRenderer, uintptr, str
1017 }1023 }
1018 cbRefPtr := purego.NewCallback(fcb)1024 cbRefPtr := purego.NewCallback(fcb)
1019 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1025 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1020- return gobject.SignalConnect(x.GoPointer(), "editing-started", cbRefPtr)1026+ handlerID := gobject.SignalConnect(x.GoPointer(), "editing-started", cbRefPtr)
1027+ glib.SaveHandlerMapping(handlerID, cbPtr)
1028+ return handlerID
1021 }1029 }
1022 1030
1023 func init() {1031 func init() {
M v4/gtk/gtkcellrendereraccel.go +14 -6
@@ -117,10 +117,12 @@ func (x *CellRendererAccel) GetPropertyKeycode() uint {
117 }117 }
118 118
119 // Gets emitted when the user has removed the accelerator.119 // Gets emitted when the user has removed the accelerator.
120-func (x *CellRendererAccel) ConnectAccelCleared(cb *func(CellRendererAccel, string)) uint32 {120+func (x *CellRendererAccel) ConnectAccelCleared(cb *func(CellRendererAccel, string)) uint {
121 cbPtr := uintptr(unsafe.Pointer(cb))121 cbPtr := uintptr(unsafe.Pointer(cb))
122 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {122 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
123- return gobject.SignalConnect(x.GoPointer(), "accel-cleared", cbRefPtr)123+ handlerID := gobject.SignalConnect(x.GoPointer(), "accel-cleared", cbRefPtr)
124+ glib.SaveHandlerMapping(handlerID, cbPtr)
125+ return handlerID
124 }126 }
125 127
126 fcb := func(clsPtr uintptr, PathStringVarp string) {128 fcb := func(clsPtr uintptr, PathStringVarp string) {
@@ -133,14 +135,18 @@ func (x *CellRendererAccel) ConnectAccelCleared(cb *func(CellRendererAccel, stri
133 }135 }
134 cbRefPtr := purego.NewCallback(fcb)136 cbRefPtr := purego.NewCallback(fcb)
135 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)137 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
136- return gobject.SignalConnect(x.GoPointer(), "accel-cleared", cbRefPtr)138+ handlerID := gobject.SignalConnect(x.GoPointer(), "accel-cleared", cbRefPtr)
139+ glib.SaveHandlerMapping(handlerID, cbPtr)
140+ return handlerID
137 }141 }
138 142
139 // Gets emitted when the user has selected a new accelerator.143 // Gets emitted when the user has selected a new accelerator.
140-func (x *CellRendererAccel) ConnectAccelEdited(cb *func(CellRendererAccel, string, uint, gdk.ModifierType, uint)) uint32 {144+func (x *CellRendererAccel) ConnectAccelEdited(cb *func(CellRendererAccel, string, uint, gdk.ModifierType, uint)) uint {
141 cbPtr := uintptr(unsafe.Pointer(cb))145 cbPtr := uintptr(unsafe.Pointer(cb))
142 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {146 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
143- return gobject.SignalConnect(x.GoPointer(), "accel-edited", cbRefPtr)147+ handlerID := gobject.SignalConnect(x.GoPointer(), "accel-edited", cbRefPtr)
148+ glib.SaveHandlerMapping(handlerID, cbPtr)
149+ return handlerID
144 }150 }
145 151
146 fcb := func(clsPtr uintptr, PathStringVarp string, AccelKeyVarp uint, AccelModsVarp gdk.ModifierType, HardwareKeycodeVarp uint) {152 fcb := func(clsPtr uintptr, PathStringVarp string, AccelKeyVarp uint, AccelModsVarp gdk.ModifierType, HardwareKeycodeVarp uint) {
@@ -153,7 +159,9 @@ func (x *CellRendererAccel) ConnectAccelEdited(cb *func(CellRendererAccel, strin
153 }159 }
154 cbRefPtr := purego.NewCallback(fcb)160 cbRefPtr := purego.NewCallback(fcb)
155 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)161 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
156- return gobject.SignalConnect(x.GoPointer(), "accel-edited", cbRefPtr)162+ handlerID := gobject.SignalConnect(x.GoPointer(), "accel-edited", cbRefPtr)
163+ glib.SaveHandlerMapping(handlerID, cbPtr)
164+ return handlerID
157 }165 }
158 166
159 func init() {167 func init() {
M v4/gtk/gtkcellrenderercombo.go +7 -3
@@ -136,10 +136,12 @@ func (x *CellRendererCombo) GetPropertyTextColumn() int {
136 // the tree view will immediately cease the editing operating. This136 // the tree view will immediately cease the editing operating. This
137 // means that you most probably want to refrain from changing the model137 // means that you most probably want to refrain from changing the model
138 // until the combo cell renderer emits the edited or editing_canceled signal.138 // until the combo cell renderer emits the edited or editing_canceled signal.
139-func (x *CellRendererCombo) ConnectChanged(cb *func(CellRendererCombo, string, uintptr)) uint32 {139+func (x *CellRendererCombo) ConnectChanged(cb *func(CellRendererCombo, string, uintptr)) uint {
140 cbPtr := uintptr(unsafe.Pointer(cb))140 cbPtr := uintptr(unsafe.Pointer(cb))
141 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {141 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
142- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)142+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
143+ glib.SaveHandlerMapping(handlerID, cbPtr)
144+ return handlerID
143 }145 }
144 146
145 fcb := func(clsPtr uintptr, PathStringVarp string, NewIterVarp uintptr) {147 fcb := func(clsPtr uintptr, PathStringVarp string, NewIterVarp uintptr) {
@@ -152,7 +154,9 @@ func (x *CellRendererCombo) ConnectChanged(cb *func(CellRendererCombo, string, u
152 }154 }
153 cbRefPtr := purego.NewCallback(fcb)155 cbRefPtr := purego.NewCallback(fcb)
154 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)156 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
155- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)157+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
158+ glib.SaveHandlerMapping(handlerID, cbPtr)
159+ return handlerID
156 }160 }
157 161
158 func init() {162 func init() {
M v4/gtk/gtkcellrenderertext.go +7 -3
@@ -726,10 +726,12 @@ func (x *CellRendererText) GetPropertyWrapWidth() int {
726 //726 //
727 // It is the responsibility of the application to update the model727 // It is the responsibility of the application to update the model
728 // and store @new_text at the position indicated by @path.728 // and store @new_text at the position indicated by @path.
729-func (x *CellRendererText) ConnectEdited(cb *func(CellRendererText, string, string)) uint32 {729+func (x *CellRendererText) ConnectEdited(cb *func(CellRendererText, string, string)) uint {
730 cbPtr := uintptr(unsafe.Pointer(cb))730 cbPtr := uintptr(unsafe.Pointer(cb))
731 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {731 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
732- return gobject.SignalConnect(x.GoPointer(), "edited", cbRefPtr)732+ handlerID := gobject.SignalConnect(x.GoPointer(), "edited", cbRefPtr)
733+ glib.SaveHandlerMapping(handlerID, cbPtr)
734+ return handlerID
733 }735 }
734 736
735 fcb := func(clsPtr uintptr, PathVarp string, NewTextVarp string) {737 fcb := func(clsPtr uintptr, PathVarp string, NewTextVarp string) {
@@ -742,7 +744,9 @@ func (x *CellRendererText) ConnectEdited(cb *func(CellRendererText, string, stri
742 }744 }
743 cbRefPtr := purego.NewCallback(fcb)745 cbRefPtr := purego.NewCallback(fcb)
744 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)746 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
745- return gobject.SignalConnect(x.GoPointer(), "edited", cbRefPtr)747+ handlerID := gobject.SignalConnect(x.GoPointer(), "edited", cbRefPtr)
748+ glib.SaveHandlerMapping(handlerID, cbPtr)
749+ return handlerID
746 }750 }
747 751
748 func init() {752 func init() {
M v4/gtk/gtkcellrenderertoggle.go +7 -3
@@ -197,10 +197,12 @@ func (x *CellRendererToggle) GetPropertyRadio() bool {
197 // It is the responsibility of the application to update the model197 // It is the responsibility of the application to update the model
198 // with the correct value to store at @path. Often this is simply the198 // with the correct value to store at @path. Often this is simply the
199 // opposite of the value currently stored at @path.199 // opposite of the value currently stored at @path.
200-func (x *CellRendererToggle) ConnectToggled(cb *func(CellRendererToggle, string)) uint32 {200+func (x *CellRendererToggle) ConnectToggled(cb *func(CellRendererToggle, string)) uint {
201 cbPtr := uintptr(unsafe.Pointer(cb))201 cbPtr := uintptr(unsafe.Pointer(cb))
202 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {202 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
203- return gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)203+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
204+ glib.SaveHandlerMapping(handlerID, cbPtr)
205+ return handlerID
204 }206 }
205 207
206 fcb := func(clsPtr uintptr, PathVarp string) {208 fcb := func(clsPtr uintptr, PathVarp string) {
@@ -213,7 +215,9 @@ func (x *CellRendererToggle) ConnectToggled(cb *func(CellRendererToggle, string)
213 }215 }
214 cbRefPtr := purego.NewCallback(fcb)216 cbRefPtr := purego.NewCallback(fcb)
215 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)217 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
216- return gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)218+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
219+ glib.SaveHandlerMapping(handlerID, cbPtr)
220+ return handlerID
217 }221 }
218 222
219 func init() {223 func init() {
M v4/gtk/gtkcheckbutton.go +14 -6
@@ -472,10 +472,12 @@ func (x *CheckButton) GetPropertyUseUnderline() bool {
472 //472 //
473 // The default bindings for this signal are all forms of the473 // The default bindings for this signal are all forms of the
474 // &lt;kbd&gt;␣&lt;/kbd&gt; and &lt;kbd&gt;Enter&lt;/kbd&gt; keys.474 // &lt;kbd&gt;␣&lt;/kbd&gt; and &lt;kbd&gt;Enter&lt;/kbd&gt; keys.
475-func (x *CheckButton) ConnectActivate(cb *func(CheckButton)) uint32 {475+func (x *CheckButton) ConnectActivate(cb *func(CheckButton)) uint {
476 cbPtr := uintptr(unsafe.Pointer(cb))476 cbPtr := uintptr(unsafe.Pointer(cb))
477 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {477 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
478- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)478+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
479+ glib.SaveHandlerMapping(handlerID, cbPtr)
480+ return handlerID
479 }481 }
480 482
481 fcb := func(clsPtr uintptr) {483 fcb := func(clsPtr uintptr) {
@@ -488,15 +490,19 @@ func (x *CheckButton) ConnectActivate(cb *func(CheckButton)) uint32 {
488 }490 }
489 cbRefPtr := purego.NewCallback(fcb)491 cbRefPtr := purego.NewCallback(fcb)
490 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)492 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
491- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)493+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
494+ glib.SaveHandlerMapping(handlerID, cbPtr)
495+ return handlerID
492 }496 }
493 497
494 // Emitted when the buttons's [property@Gtk.CheckButton:active]498 // Emitted when the buttons's [property@Gtk.CheckButton:active]
495 // property changes.499 // property changes.
496-func (x *CheckButton) ConnectToggled(cb *func(CheckButton)) uint32 {500+func (x *CheckButton) ConnectToggled(cb *func(CheckButton)) uint {
497 cbPtr := uintptr(unsafe.Pointer(cb))501 cbPtr := uintptr(unsafe.Pointer(cb))
498 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {502 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
499- return gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)503+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
504+ glib.SaveHandlerMapping(handlerID, cbPtr)
505+ return handlerID
500 }506 }
501 507
502 fcb := func(clsPtr uintptr) {508 fcb := func(clsPtr uintptr) {
@@ -509,7 +515,9 @@ func (x *CheckButton) ConnectToggled(cb *func(CheckButton)) uint32 {
509 }515 }
510 cbRefPtr := purego.NewCallback(fcb)516 cbRefPtr := purego.NewCallback(fcb)
511 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)517 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
512- return gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)518+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
519+ glib.SaveHandlerMapping(handlerID, cbPtr)
520+ return handlerID
513 }521 }
514 522
515 // Requests the user's screen reader to announce the given message.523 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcolorbutton.go +14 -6
@@ -205,10 +205,12 @@ func (x *ColorButton) GetPropertyTitle() string {
205 //205 //
206 // The `::activate` signal on `GtkMenuButton` is an action signal and206 // The `::activate` signal on `GtkMenuButton` is an action signal and
207 // emitting it causes the button to pop up its dialog.207 // emitting it causes the button to pop up its dialog.
208-func (x *ColorButton) ConnectActivate(cb *func(ColorButton)) uint32 {208+func (x *ColorButton) ConnectActivate(cb *func(ColorButton)) uint {
209 cbPtr := uintptr(unsafe.Pointer(cb))209 cbPtr := uintptr(unsafe.Pointer(cb))
210 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {210 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
211- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)211+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
212+ glib.SaveHandlerMapping(handlerID, cbPtr)
213+ return handlerID
212 }214 }
213 215
214 fcb := func(clsPtr uintptr) {216 fcb := func(clsPtr uintptr) {
@@ -221,7 +223,9 @@ func (x *ColorButton) ConnectActivate(cb *func(ColorButton)) uint32 {
221 }223 }
222 cbRefPtr := purego.NewCallback(fcb)224 cbRefPtr := purego.NewCallback(fcb)
223 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)225 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
224- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)226+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
227+ glib.SaveHandlerMapping(handlerID, cbPtr)
228+ return handlerID
225 }229 }
226 230
227 // Emitted when the user selects a color.231 // Emitted when the user selects a color.
@@ -232,10 +236,12 @@ func (x *ColorButton) ConnectActivate(cb *func(ColorButton)) uint32 {
232 // Note that this signal is only emitted when the user changes the color.236 // Note that this signal is only emitted when the user changes the color.
233 // If you need to react to programmatic color changes as well, use237 // If you need to react to programmatic color changes as well, use
234 // the notify::rgba signal.238 // the notify::rgba signal.
235-func (x *ColorButton) ConnectColorSet(cb *func(ColorButton)) uint32 {239+func (x *ColorButton) ConnectColorSet(cb *func(ColorButton)) uint {
236 cbPtr := uintptr(unsafe.Pointer(cb))240 cbPtr := uintptr(unsafe.Pointer(cb))
237 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {241 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
238- return gobject.SignalConnect(x.GoPointer(), "color-set", cbRefPtr)242+ handlerID := gobject.SignalConnect(x.GoPointer(), "color-set", cbRefPtr)
243+ glib.SaveHandlerMapping(handlerID, cbPtr)
244+ return handlerID
239 }245 }
240 246
241 fcb := func(clsPtr uintptr) {247 fcb := func(clsPtr uintptr) {
@@ -248,7 +254,9 @@ func (x *ColorButton) ConnectColorSet(cb *func(ColorButton)) uint32 {
248 }254 }
249 cbRefPtr := purego.NewCallback(fcb)255 cbRefPtr := purego.NewCallback(fcb)
250 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)256 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
251- return gobject.SignalConnect(x.GoPointer(), "color-set", cbRefPtr)257+ handlerID := gobject.SignalConnect(x.GoPointer(), "color-set", cbRefPtr)
258+ glib.SaveHandlerMapping(handlerID, cbPtr)
259+ return handlerID
252 }260 }
253 261
254 // Requests the user's screen reader to announce the given message.262 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcolordialogbutton.go +7 -3
@@ -181,10 +181,12 @@ func (x *ColorDialogButton) GetPropertyRgba() uintptr {
181 //181 //
182 // The `::activate` signal on `GtkColorDialogButton` is an action signal182 // The `::activate` signal on `GtkColorDialogButton` is an action signal
183 // and emitting it causes the button to pop up its dialog.183 // and emitting it causes the button to pop up its dialog.
184-func (x *ColorDialogButton) ConnectActivate(cb *func(ColorDialogButton)) uint32 {184+func (x *ColorDialogButton) ConnectActivate(cb *func(ColorDialogButton)) uint {
185 cbPtr := uintptr(unsafe.Pointer(cb))185 cbPtr := uintptr(unsafe.Pointer(cb))
186 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {186 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
187- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)187+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
188+ glib.SaveHandlerMapping(handlerID, cbPtr)
189+ return handlerID
188 }190 }
189 191
190 fcb := func(clsPtr uintptr) {192 fcb := func(clsPtr uintptr) {
@@ -197,7 +199,9 @@ func (x *ColorDialogButton) ConnectActivate(cb *func(ColorDialogButton)) uint32
197 }199 }
198 cbRefPtr := purego.NewCallback(fcb)200 cbRefPtr := purego.NewCallback(fcb)
199 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)201 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
200- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)202+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
203+ glib.SaveHandlerMapping(handlerID, cbPtr)
204+ return handlerID
201 }205 }
202 206
203 // Requests the user's screen reader to announce the given message.207 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcolumnview.go +7 -3
@@ -554,10 +554,12 @@ func (x *ColumnView) GetPropertySingleClickActivate() bool {
554 // This allows for a convenient way to handle activation in a columnview.554 // This allows for a convenient way to handle activation in a columnview.
555 // See [method@Gtk.ListItem.set_activatable] for details on how to use this555 // See [method@Gtk.ListItem.set_activatable] for details on how to use this
556 // signal.556 // signal.
557-func (x *ColumnView) ConnectActivate(cb *func(ColumnView, uint)) uint32 {557+func (x *ColumnView) ConnectActivate(cb *func(ColumnView, uint)) uint {
558 cbPtr := uintptr(unsafe.Pointer(cb))558 cbPtr := uintptr(unsafe.Pointer(cb))
559 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {559 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
560- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)560+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
561+ glib.SaveHandlerMapping(handlerID, cbPtr)
562+ return handlerID
561 }563 }
562 564
563 fcb := func(clsPtr uintptr, PositionVarp uint) {565 fcb := func(clsPtr uintptr, PositionVarp uint) {
@@ -570,7 +572,9 @@ func (x *ColumnView) ConnectActivate(cb *func(ColumnView, uint)) uint32 {
570 }572 }
571 cbRefPtr := purego.NewCallback(fcb)573 cbRefPtr := purego.NewCallback(fcb)
572 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)574 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
573- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)575+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
576+ glib.SaveHandlerMapping(handlerID, cbPtr)
577+ return handlerID
574 }578 }
575 579
576 // Requests the user's screen reader to announce the given message.580 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcombobox.go +42 -18
@@ -779,10 +779,12 @@ func (x *ComboBox) GetPropertyPopupShown() bool {
779 //779 //
780 // The `::activate` signal on `GtkComboBox` is an action signal and780 // The `::activate` signal on `GtkComboBox` is an action signal and
781 // emitting it causes the combo box to pop up its dropdown.781 // emitting it causes the combo box to pop up its dropdown.
782-func (x *ComboBox) ConnectActivate(cb *func(ComboBox)) uint32 {782+func (x *ComboBox) ConnectActivate(cb *func(ComboBox)) uint {
783 cbPtr := uintptr(unsafe.Pointer(cb))783 cbPtr := uintptr(unsafe.Pointer(cb))
784 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {784 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
785- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)785+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
786+ glib.SaveHandlerMapping(handlerID, cbPtr)
787+ return handlerID
786 }788 }
787 789
788 fcb := func(clsPtr uintptr) {790 fcb := func(clsPtr uintptr) {
@@ -795,7 +797,9 @@ func (x *ComboBox) ConnectActivate(cb *func(ComboBox)) uint32 {
795 }797 }
796 cbRefPtr := purego.NewCallback(fcb)798 cbRefPtr := purego.NewCallback(fcb)
797 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)799 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
798- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)800+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
801+ glib.SaveHandlerMapping(handlerID, cbPtr)
802+ return handlerID
799 }803 }
800 804
801 // Emitted when the active item is changed.805 // Emitted when the active item is changed.
@@ -803,10 +807,12 @@ func (x *ComboBox) ConnectActivate(cb *func(ComboBox)) uint32 {
803 // The can be due to the user selecting a different item from the list,807 // The can be due to the user selecting a different item from the list,
804 // or due to a call to [method@Gtk.ComboBox.set_active_iter]. It will808 // or due to a call to [method@Gtk.ComboBox.set_active_iter]. It will
805 // also be emitted while typing into the entry of a combo box with an entry.809 // also be emitted while typing into the entry of a combo box with an entry.
806-func (x *ComboBox) ConnectChanged(cb *func(ComboBox)) uint32 {810+func (x *ComboBox) ConnectChanged(cb *func(ComboBox)) uint {
807 cbPtr := uintptr(unsafe.Pointer(cb))811 cbPtr := uintptr(unsafe.Pointer(cb))
808 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {812 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
809- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)813+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
814+ glib.SaveHandlerMapping(handlerID, cbPtr)
815+ return handlerID
810 }816 }
811 817
812 fcb := func(clsPtr uintptr) {818 fcb := func(clsPtr uintptr) {
@@ -819,7 +825,9 @@ func (x *ComboBox) ConnectChanged(cb *func(ComboBox)) uint32 {
819 }825 }
820 cbRefPtr := purego.NewCallback(fcb)826 cbRefPtr := purego.NewCallback(fcb)
821 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)827 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
822- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)828+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
829+ glib.SaveHandlerMapping(handlerID, cbPtr)
830+ return handlerID
823 }831 }
824 832
825 // Emitted to allow changing how the text in a combo box's entry is displayed.833 // Emitted to allow changing how the text in a combo box's entry is displayed.
@@ -856,10 +864,12 @@ func (x *ComboBox) ConnectChanged(cb *func(ComboBox)) uint32 {
856 // }864 // }
857 //865 //
858 // ```866 // ```
859-func (x *ComboBox) ConnectFormatEntryText(cb *func(ComboBox, string) string) uint32 {867+func (x *ComboBox) ConnectFormatEntryText(cb *func(ComboBox, string) string) uint {
860 cbPtr := uintptr(unsafe.Pointer(cb))868 cbPtr := uintptr(unsafe.Pointer(cb))
861 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {869 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
862- return gobject.SignalConnect(x.GoPointer(), "format-entry-text", cbRefPtr)870+ handlerID := gobject.SignalConnect(x.GoPointer(), "format-entry-text", cbRefPtr)
871+ glib.SaveHandlerMapping(handlerID, cbPtr)
872+ return handlerID
863 }873 }
864 874
865 fcb := func(clsPtr uintptr, PathVarp string) string {875 fcb := func(clsPtr uintptr, PathVarp string) string {
@@ -872,16 +882,20 @@ func (x *ComboBox) ConnectFormatEntryText(cb *func(ComboBox, string) string) uin
872 }882 }
873 cbRefPtr := purego.NewCallback(fcb)883 cbRefPtr := purego.NewCallback(fcb)
874 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)884 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
875- return gobject.SignalConnect(x.GoPointer(), "format-entry-text", cbRefPtr)885+ handlerID := gobject.SignalConnect(x.GoPointer(), "format-entry-text", cbRefPtr)
886+ glib.SaveHandlerMapping(handlerID, cbPtr)
887+ return handlerID
876 }888 }
877 889
878 // Emitted to move the active selection.890 // Emitted to move the active selection.
879 //891 //
880 // This is an [keybinding signal](class.SignalAction.html).892 // This is an [keybinding signal](class.SignalAction.html).
881-func (x *ComboBox) ConnectMoveActive(cb *func(ComboBox, ScrollType)) uint32 {893+func (x *ComboBox) ConnectMoveActive(cb *func(ComboBox, ScrollType)) uint {
882 cbPtr := uintptr(unsafe.Pointer(cb))894 cbPtr := uintptr(unsafe.Pointer(cb))
883 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {895 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
884- return gobject.SignalConnect(x.GoPointer(), "move-active", cbRefPtr)896+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-active", cbRefPtr)
897+ glib.SaveHandlerMapping(handlerID, cbPtr)
898+ return handlerID
885 }899 }
886 900
887 fcb := func(clsPtr uintptr, ScrollTypeVarp ScrollType) {901 fcb := func(clsPtr uintptr, ScrollTypeVarp ScrollType) {
@@ -894,7 +908,9 @@ func (x *ComboBox) ConnectMoveActive(cb *func(ComboBox, ScrollType)) uint32 {
894 }908 }
895 cbRefPtr := purego.NewCallback(fcb)909 cbRefPtr := purego.NewCallback(fcb)
896 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)910 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
897- return gobject.SignalConnect(x.GoPointer(), "move-active", cbRefPtr)911+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-active", cbRefPtr)
912+ glib.SaveHandlerMapping(handlerID, cbPtr)
913+ return handlerID
898 }914 }
899 915
900 // Emitted to popdown the combo box list.916 // Emitted to popdown the combo box list.
@@ -902,10 +918,12 @@ func (x *ComboBox) ConnectMoveActive(cb *func(ComboBox, ScrollType)) uint32 {
902 // This is an [keybinding signal](class.SignalAction.html).918 // This is an [keybinding signal](class.SignalAction.html).
903 //919 //
904 // The default bindings for this signal are Alt+Up and Escape.920 // The default bindings for this signal are Alt+Up and Escape.
905-func (x *ComboBox) ConnectPopdown(cb *func(ComboBox) bool) uint32 {921+func (x *ComboBox) ConnectPopdown(cb *func(ComboBox) bool) uint {
906 cbPtr := uintptr(unsafe.Pointer(cb))922 cbPtr := uintptr(unsafe.Pointer(cb))
907 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {923 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
908- return gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)924+ handlerID := gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)
925+ glib.SaveHandlerMapping(handlerID, cbPtr)
926+ return handlerID
909 }927 }
910 928
911 fcb := func(clsPtr uintptr) bool {929 fcb := func(clsPtr uintptr) bool {
@@ -918,7 +936,9 @@ func (x *ComboBox) ConnectPopdown(cb *func(ComboBox) bool) uint32 {
918 }936 }
919 cbRefPtr := purego.NewCallback(fcb)937 cbRefPtr := purego.NewCallback(fcb)
920 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)938 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
921- return gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)939+ handlerID := gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)
940+ glib.SaveHandlerMapping(handlerID, cbPtr)
941+ return handlerID
922 }942 }
923 943
924 // Emitted to popup the combo box list.944 // Emitted to popup the combo box list.
@@ -926,10 +946,12 @@ func (x *ComboBox) ConnectPopdown(cb *func(ComboBox) bool) uint32 {
926 // This is an [keybinding signal](class.SignalAction.html).946 // This is an [keybinding signal](class.SignalAction.html).
927 //947 //
928 // The default binding for this signal is Alt+Down.948 // The default binding for this signal is Alt+Down.
929-func (x *ComboBox) ConnectPopup(cb *func(ComboBox)) uint32 {949+func (x *ComboBox) ConnectPopup(cb *func(ComboBox)) uint {
930 cbPtr := uintptr(unsafe.Pointer(cb))950 cbPtr := uintptr(unsafe.Pointer(cb))
931 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {951 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
932- return gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)952+ handlerID := gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)
953+ glib.SaveHandlerMapping(handlerID, cbPtr)
954+ return handlerID
933 }955 }
934 956
935 fcb := func(clsPtr uintptr) {957 fcb := func(clsPtr uintptr) {
@@ -942,7 +964,9 @@ func (x *ComboBox) ConnectPopup(cb *func(ComboBox)) uint32 {
942 }964 }
943 cbRefPtr := purego.NewCallback(fcb)965 cbRefPtr := purego.NewCallback(fcb)
944 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)966 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
945- return gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)967+ handlerID := gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)
968+ glib.SaveHandlerMapping(handlerID, cbPtr)
969+ return handlerID
946 }970 }
947 971
948 // Requests the user's screen reader to announce the given message.972 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkcssprovider.go +7 -3
@@ -220,10 +220,12 @@ func (c *CssProvider) SetGoPointer(ptr uintptr) {
220 // Note that this signal may be emitted at any time as the css provider220 // Note that this signal may be emitted at any time as the css provider
221 // may opt to defer parsing parts or all of the input to a later time221 // may opt to defer parsing parts or all of the input to a later time
222 // than when a loading function was called.222 // than when a loading function was called.
223-func (x *CssProvider) ConnectParsingError(cb *func(CssProvider, uintptr, uintptr)) uint32 {223+func (x *CssProvider) ConnectParsingError(cb *func(CssProvider, uintptr, uintptr)) uint {
224 cbPtr := uintptr(unsafe.Pointer(cb))224 cbPtr := uintptr(unsafe.Pointer(cb))
225 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {225 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
226- return gobject.SignalConnect(x.GoPointer(), "parsing-error", cbRefPtr)226+ handlerID := gobject.SignalConnect(x.GoPointer(), "parsing-error", cbRefPtr)
227+ glib.SaveHandlerMapping(handlerID, cbPtr)
228+ return handlerID
227 }229 }
228 230
229 fcb := func(clsPtr uintptr, SectionVarp uintptr, ErrorVarp uintptr) {231 fcb := func(clsPtr uintptr, SectionVarp uintptr, ErrorVarp uintptr) {
@@ -236,7 +238,9 @@ func (x *CssProvider) ConnectParsingError(cb *func(CssProvider, uintptr, uintptr
236 }238 }
237 cbRefPtr := purego.NewCallback(fcb)239 cbRefPtr := purego.NewCallback(fcb)
238 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)240 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
239- return gobject.SignalConnect(x.GoPointer(), "parsing-error", cbRefPtr)241+ handlerID := gobject.SignalConnect(x.GoPointer(), "parsing-error", cbRefPtr)
242+ glib.SaveHandlerMapping(handlerID, cbPtr)
243+ return handlerID
240 }244 }
241 245
242 func init() {246 func init() {
M v4/gtk/gtkdialog.go +14 -6
@@ -586,10 +586,12 @@ func (x *Dialog) GetPropertyUseHeaderBar() int {
586 // This is a [keybinding signal](class.SignalAction.html).586 // This is a [keybinding signal](class.SignalAction.html).
587 //587 //
588 // The default binding for this signal is the Escape key.588 // The default binding for this signal is the Escape key.
589-func (x *Dialog) ConnectClose(cb *func(Dialog)) uint32 {589+func (x *Dialog) ConnectClose(cb *func(Dialog)) uint {
590 cbPtr := uintptr(unsafe.Pointer(cb))590 cbPtr := uintptr(unsafe.Pointer(cb))
591 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {591 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
592- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)592+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
593+ glib.SaveHandlerMapping(handlerID, cbPtr)
594+ return handlerID
593 }595 }
594 596
595 fcb := func(clsPtr uintptr) {597 fcb := func(clsPtr uintptr) {
@@ -602,7 +604,9 @@ func (x *Dialog) ConnectClose(cb *func(Dialog)) uint32 {
602 }604 }
603 cbRefPtr := purego.NewCallback(fcb)605 cbRefPtr := purego.NewCallback(fcb)
604 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)606 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
605- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)607+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
608+ glib.SaveHandlerMapping(handlerID, cbPtr)
609+ return handlerID
606 }610 }
607 611
608 // Emitted when an action widget is clicked.612 // Emitted when an action widget is clicked.
@@ -611,10 +615,12 @@ func (x *Dialog) ConnectClose(cb *func(Dialog)) uint32 {
611 // delete event, and when [method@Gtk.Dialog.response] is called.615 // delete event, and when [method@Gtk.Dialog.response] is called.
612 // On a delete event, the response ID is %GTK_RESPONSE_DELETE_EVENT.616 // On a delete event, the response ID is %GTK_RESPONSE_DELETE_EVENT.
613 // Otherwise, it depends on which action widget was clicked.617 // Otherwise, it depends on which action widget was clicked.
614-func (x *Dialog) ConnectResponse(cb *func(Dialog, int)) uint32 {618+func (x *Dialog) ConnectResponse(cb *func(Dialog, int)) uint {
615 cbPtr := uintptr(unsafe.Pointer(cb))619 cbPtr := uintptr(unsafe.Pointer(cb))
616 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {620 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
617- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)621+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
622+ glib.SaveHandlerMapping(handlerID, cbPtr)
623+ return handlerID
618 }624 }
619 625
620 fcb := func(clsPtr uintptr, ResponseIdVarp int) {626 fcb := func(clsPtr uintptr, ResponseIdVarp int) {
@@ -627,7 +633,9 @@ func (x *Dialog) ConnectResponse(cb *func(Dialog, int)) uint32 {
627 }633 }
628 cbRefPtr := purego.NewCallback(fcb)634 cbRefPtr := purego.NewCallback(fcb)
629 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)635 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
630- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)636+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
637+ glib.SaveHandlerMapping(handlerID, cbPtr)
638+ return handlerID
631 }639 }
632 640
633 // Requests the user's screen reader to announce the given message.641 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkdragsource.go +28 -12
@@ -258,10 +258,12 @@ func (c *DragSource) SetGoPointer(ptr uintptr) {
258 //258 //
259 // It can be used to e.g. set a custom drag icon with259 // It can be used to e.g. set a custom drag icon with
260 // [method@Gtk.DragSource.set_icon].260 // [method@Gtk.DragSource.set_icon].
261-func (x *DragSource) ConnectDragBegin(cb *func(DragSource, uintptr)) uint32 {261+func (x *DragSource) ConnectDragBegin(cb *func(DragSource, uintptr)) uint {
262 cbPtr := uintptr(unsafe.Pointer(cb))262 cbPtr := uintptr(unsafe.Pointer(cb))
263 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {263 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
264- return gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)264+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)
265+ glib.SaveHandlerMapping(handlerID, cbPtr)
266+ return handlerID
265 }267 }
266 268
267 fcb := func(clsPtr uintptr, DragVarp uintptr) {269 fcb := func(clsPtr uintptr, DragVarp uintptr) {
@@ -274,7 +276,9 @@ func (x *DragSource) ConnectDragBegin(cb *func(DragSource, uintptr)) uint32 {
274 }276 }
275 cbRefPtr := purego.NewCallback(fcb)277 cbRefPtr := purego.NewCallback(fcb)
276 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)278 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
277- return gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)279+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)
280+ glib.SaveHandlerMapping(handlerID, cbPtr)
281+ return handlerID
278 }282 }
279 283
280 // Emitted on the drag source when a drag has failed.284 // Emitted on the drag source when a drag has failed.
@@ -282,10 +286,12 @@ func (x *DragSource) ConnectDragBegin(cb *func(DragSource, uintptr)) uint32 {
282 // The signal handler may handle a failed drag operation based on286 // The signal handler may handle a failed drag operation based on
283 // the type of error. It should return %TRUE if the failure has been handled287 // the type of error. It should return %TRUE if the failure has been handled
284 // and the default "drag operation failed" animation should not be shown.288 // and the default "drag operation failed" animation should not be shown.
285-func (x *DragSource) ConnectDragCancel(cb *func(DragSource, uintptr, gdk.DragCancelReason) bool) uint32 {289+func (x *DragSource) ConnectDragCancel(cb *func(DragSource, uintptr, gdk.DragCancelReason) bool) uint {
286 cbPtr := uintptr(unsafe.Pointer(cb))290 cbPtr := uintptr(unsafe.Pointer(cb))
287 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {291 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
288- return gobject.SignalConnect(x.GoPointer(), "drag-cancel", cbRefPtr)292+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-cancel", cbRefPtr)
293+ glib.SaveHandlerMapping(handlerID, cbPtr)
294+ return handlerID
289 }295 }
290 296
291 fcb := func(clsPtr uintptr, DragVarp uintptr, ReasonVarp gdk.DragCancelReason) bool {297 fcb := func(clsPtr uintptr, DragVarp uintptr, ReasonVarp gdk.DragCancelReason) bool {
@@ -298,7 +304,9 @@ func (x *DragSource) ConnectDragCancel(cb *func(DragSource, uintptr, gdk.DragCan
298 }304 }
299 cbRefPtr := purego.NewCallback(fcb)305 cbRefPtr := purego.NewCallback(fcb)
300 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)306 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
301- return gobject.SignalConnect(x.GoPointer(), "drag-cancel", cbRefPtr)307+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-cancel", cbRefPtr)
308+ glib.SaveHandlerMapping(handlerID, cbPtr)
309+ return handlerID
302 }310 }
303 311
304 // Emitted on the drag source when a drag is finished.312 // Emitted on the drag source when a drag is finished.
@@ -306,10 +314,12 @@ func (x *DragSource) ConnectDragCancel(cb *func(DragSource, uintptr, gdk.DragCan
306 // A typical reason to connect to this signal is to undo314 // A typical reason to connect to this signal is to undo
307 // things done in [signal@Gtk.DragSource::prepare] or315 // things done in [signal@Gtk.DragSource::prepare] or
308 // [signal@Gtk.DragSource::drag-begin] handlers.316 // [signal@Gtk.DragSource::drag-begin] handlers.
309-func (x *DragSource) ConnectDragEnd(cb *func(DragSource, uintptr, bool)) uint32 {317+func (x *DragSource) ConnectDragEnd(cb *func(DragSource, uintptr, bool)) uint {
310 cbPtr := uintptr(unsafe.Pointer(cb))318 cbPtr := uintptr(unsafe.Pointer(cb))
311 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {319 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
312- return gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)320+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)
321+ glib.SaveHandlerMapping(handlerID, cbPtr)
322+ return handlerID
313 }323 }
314 324
315 fcb := func(clsPtr uintptr, DragVarp uintptr, DeleteDataVarp bool) {325 fcb := func(clsPtr uintptr, DragVarp uintptr, DeleteDataVarp bool) {
@@ -322,7 +332,9 @@ func (x *DragSource) ConnectDragEnd(cb *func(DragSource, uintptr, bool)) uint32
322 }332 }
323 cbRefPtr := purego.NewCallback(fcb)333 cbRefPtr := purego.NewCallback(fcb)
324 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)334 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
325- return gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)335+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)
336+ glib.SaveHandlerMapping(handlerID, cbPtr)
337+ return handlerID
326 }338 }
327 339
328 // Emitted when a drag is about to be initiated.340 // Emitted when a drag is about to be initiated.
@@ -331,10 +343,12 @@ func (x *DragSource) ConnectDragEnd(cb *func(DragSource, uintptr, bool)) uint32
331 // to start. The default handler for this signal returns the value of343 // to start. The default handler for this signal returns the value of
332 // the [property@Gtk.DragSource:content] property, so if you set up that344 // the [property@Gtk.DragSource:content] property, so if you set up that
333 // property ahead of time, you don't need to connect to this signal.345 // property ahead of time, you don't need to connect to this signal.
334-func (x *DragSource) ConnectPrepare(cb *func(DragSource, float64, float64) gdk.ContentProvider) uint32 {346+func (x *DragSource) ConnectPrepare(cb *func(DragSource, float64, float64) gdk.ContentProvider) uint {
335 cbPtr := uintptr(unsafe.Pointer(cb))347 cbPtr := uintptr(unsafe.Pointer(cb))
336 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {348 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
337- return gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)349+ handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
350+ glib.SaveHandlerMapping(handlerID, cbPtr)
351+ return handlerID
338 }352 }
339 353
340 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) uintptr {354 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) uintptr {
@@ -348,7 +362,9 @@ func (x *DragSource) ConnectPrepare(cb *func(DragSource, float64, float64) gdk.C
348 }362 }
349 cbRefPtr := purego.NewCallback(fcb)363 cbRefPtr := purego.NewCallback(fcb)
350 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)364 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
351- return gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)365+ handlerID := gobject.SignalConnect(x.GoPointer(), "prepare", cbRefPtr)
366+ glib.SaveHandlerMapping(handlerID, cbPtr)
367+ return handlerID
352 }368 }
353 369
354 func init() {370 func init() {
M v4/gtk/gtkdrawingarea.go +7 -3
@@ -330,10 +330,12 @@ func (x *DrawingArea) GetPropertyContentWidth() int {
330 //330 //
331 // This is useful in order to keep state up to date with the widget size,331 // This is useful in order to keep state up to date with the widget size,
332 // like for instance a backing surface.332 // like for instance a backing surface.
333-func (x *DrawingArea) ConnectResize(cb *func(DrawingArea, int, int)) uint32 {333+func (x *DrawingArea) ConnectResize(cb *func(DrawingArea, int, int)) uint {
334 cbPtr := uintptr(unsafe.Pointer(cb))334 cbPtr := uintptr(unsafe.Pointer(cb))
335 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {335 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
336- return gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)336+ handlerID := gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)
337+ glib.SaveHandlerMapping(handlerID, cbPtr)
338+ return handlerID
337 }339 }
338 340
339 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {341 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {
@@ -346,7 +348,9 @@ func (x *DrawingArea) ConnectResize(cb *func(DrawingArea, int, int)) uint32 {
346 }348 }
347 cbRefPtr := purego.NewCallback(fcb)349 cbRefPtr := purego.NewCallback(fcb)
348 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)350 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
349- return gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)351+ handlerID := gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)
352+ glib.SaveHandlerMapping(handlerID, cbPtr)
353+ return handlerID
350 }354 }
351 355
352 // Requests the user's screen reader to announce the given message.356 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkdropcontrollermotion.go +21 -9
@@ -143,10 +143,12 @@ func (x *DropControllerMotion) GetPropertyIsPointer() bool {
143 }143 }
144 144
145 // Signals that the pointer has entered the widget.145 // Signals that the pointer has entered the widget.
146-func (x *DropControllerMotion) ConnectEnter(cb *func(DropControllerMotion, float64, float64)) uint32 {146+func (x *DropControllerMotion) ConnectEnter(cb *func(DropControllerMotion, float64, float64)) uint {
147 cbPtr := uintptr(unsafe.Pointer(cb))147 cbPtr := uintptr(unsafe.Pointer(cb))
148 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {148 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
149- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)149+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
150+ glib.SaveHandlerMapping(handlerID, cbPtr)
151+ return handlerID
150 }152 }
151 153
152 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {154 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -159,14 +161,18 @@ func (x *DropControllerMotion) ConnectEnter(cb *func(DropControllerMotion, float
159 }161 }
160 cbRefPtr := purego.NewCallback(fcb)162 cbRefPtr := purego.NewCallback(fcb)
161 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)163 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
162- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)164+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
165+ glib.SaveHandlerMapping(handlerID, cbPtr)
166+ return handlerID
163 }167 }
164 168
165 // Signals that the pointer has left the widget.169 // Signals that the pointer has left the widget.
166-func (x *DropControllerMotion) ConnectLeave(cb *func(DropControllerMotion)) uint32 {170+func (x *DropControllerMotion) ConnectLeave(cb *func(DropControllerMotion)) uint {
167 cbPtr := uintptr(unsafe.Pointer(cb))171 cbPtr := uintptr(unsafe.Pointer(cb))
168 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {172 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
169- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)173+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
174+ glib.SaveHandlerMapping(handlerID, cbPtr)
175+ return handlerID
170 }176 }
171 177
172 fcb := func(clsPtr uintptr) {178 fcb := func(clsPtr uintptr) {
@@ -179,14 +185,18 @@ func (x *DropControllerMotion) ConnectLeave(cb *func(DropControllerMotion)) uint
179 }185 }
180 cbRefPtr := purego.NewCallback(fcb)186 cbRefPtr := purego.NewCallback(fcb)
181 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)187 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
182- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)188+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
189+ glib.SaveHandlerMapping(handlerID, cbPtr)
190+ return handlerID
183 }191 }
184 192
185 // Emitted when the pointer moves inside the widget.193 // Emitted when the pointer moves inside the widget.
186-func (x *DropControllerMotion) ConnectMotion(cb *func(DropControllerMotion, float64, float64)) uint32 {194+func (x *DropControllerMotion) ConnectMotion(cb *func(DropControllerMotion, float64, float64)) uint {
187 cbPtr := uintptr(unsafe.Pointer(cb))195 cbPtr := uintptr(unsafe.Pointer(cb))
188 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {196 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
189- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)197+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
198+ glib.SaveHandlerMapping(handlerID, cbPtr)
199+ return handlerID
190 }200 }
191 201
192 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {202 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -199,7 +209,9 @@ func (x *DropControllerMotion) ConnectMotion(cb *func(DropControllerMotion, floa
199 }209 }
200 cbRefPtr := purego.NewCallback(fcb)210 cbRefPtr := purego.NewCallback(fcb)
201 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)211 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
202- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)212+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
213+ glib.SaveHandlerMapping(handlerID, cbPtr)
214+ return handlerID
203 }215 }
204 216
205 func init() {217 func init() {
M v4/gtk/gtkdropdown.go +7 -3
@@ -453,10 +453,12 @@ func (x *DropDown) GetPropertyShowArrow() bool {
453 //453 //
454 // The `::activate` signal on `GtkDropDown` is an action signal and454 // The `::activate` signal on `GtkDropDown` is an action signal and
455 // emitting it causes the drop down to pop up its dropdown.455 // emitting it causes the drop down to pop up its dropdown.
456-func (x *DropDown) ConnectActivate(cb *func(DropDown)) uint32 {456+func (x *DropDown) ConnectActivate(cb *func(DropDown)) uint {
457 cbPtr := uintptr(unsafe.Pointer(cb))457 cbPtr := uintptr(unsafe.Pointer(cb))
458 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {458 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
459- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)459+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
460+ glib.SaveHandlerMapping(handlerID, cbPtr)
461+ return handlerID
460 }462 }
461 463
462 fcb := func(clsPtr uintptr) {464 fcb := func(clsPtr uintptr) {
@@ -469,7 +471,9 @@ func (x *DropDown) ConnectActivate(cb *func(DropDown)) uint32 {
469 }471 }
470 cbRefPtr := purego.NewCallback(fcb)472 cbRefPtr := purego.NewCallback(fcb)
471 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)473 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
472- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)474+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
475+ glib.SaveHandlerMapping(handlerID, cbPtr)
476+ return handlerID
473 }477 }
474 478
475 // Requests the user's screen reader to announce the given message.479 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkdroptarget.go +35 -15
@@ -378,10 +378,12 @@ func (x *DropTarget) GetPropertyValue() uintptr {
378 // [property@Gtk.DropTarget:preload] property should be set and the value378 // [property@Gtk.DropTarget:preload] property should be set and the value
379 // should be inspected via the ::notify:value signal, calling379 // should be inspected via the ::notify:value signal, calling
380 // [method@Gtk.DropTarget.reject] if required.380 // [method@Gtk.DropTarget.reject] if required.
381-func (x *DropTarget) ConnectAccept(cb *func(DropTarget, uintptr) bool) uint32 {381+func (x *DropTarget) ConnectAccept(cb *func(DropTarget, uintptr) bool) uint {
382 cbPtr := uintptr(unsafe.Pointer(cb))382 cbPtr := uintptr(unsafe.Pointer(cb))
383 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {383 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
384- return gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)384+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)
385+ glib.SaveHandlerMapping(handlerID, cbPtr)
386+ return handlerID
385 }387 }
386 388
387 fcb := func(clsPtr uintptr, DropVarp uintptr) bool {389 fcb := func(clsPtr uintptr, DropVarp uintptr) bool {
@@ -394,7 +396,9 @@ func (x *DropTarget) ConnectAccept(cb *func(DropTarget, uintptr) bool) uint32 {
394 }396 }
395 cbRefPtr := purego.NewCallback(fcb)397 cbRefPtr := purego.NewCallback(fcb)
396 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)398 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
397- return gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)399+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)
400+ glib.SaveHandlerMapping(handlerID, cbPtr)
401+ return handlerID
398 }402 }
399 403
400 // Emitted on the drop site when the user drops the data onto the widget.404 // Emitted on the drop site when the user drops the data onto the widget.
@@ -406,10 +410,12 @@ func (x *DropTarget) ConnectAccept(cb *func(DropTarget, uintptr) bool) uint32 {
406 // Otherwise, the handler returns %TRUE. In this case, this handler will410 // Otherwise, the handler returns %TRUE. In this case, this handler will
407 // accept the drop. The handler is responsible for using the given @value411 // accept the drop. The handler is responsible for using the given @value
408 // and performing the drop operation.412 // and performing the drop operation.
409-func (x *DropTarget) ConnectDrop(cb *func(DropTarget, uintptr, float64, float64) bool) uint32 {413+func (x *DropTarget) ConnectDrop(cb *func(DropTarget, uintptr, float64, float64) bool) uint {
410 cbPtr := uintptr(unsafe.Pointer(cb))414 cbPtr := uintptr(unsafe.Pointer(cb))
411 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {415 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
412- return gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)416+ handlerID := gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)
417+ glib.SaveHandlerMapping(handlerID, cbPtr)
418+ return handlerID
413 }419 }
414 420
415 fcb := func(clsPtr uintptr, ValueVarp uintptr, XVarp float64, YVarp float64) bool {421 fcb := func(clsPtr uintptr, ValueVarp uintptr, XVarp float64, YVarp float64) bool {
@@ -422,16 +428,20 @@ func (x *DropTarget) ConnectDrop(cb *func(DropTarget, uintptr, float64, float64)
422 }428 }
423 cbRefPtr := purego.NewCallback(fcb)429 cbRefPtr := purego.NewCallback(fcb)
424 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)430 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
425- return gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)431+ handlerID := gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)
432+ glib.SaveHandlerMapping(handlerID, cbPtr)
433+ return handlerID
426 }434 }
427 435
428 // Emitted on the drop site when the pointer enters the widget.436 // Emitted on the drop site when the pointer enters the widget.
429 //437 //
430 // It can be used to set up custom highlighting.438 // It can be used to set up custom highlighting.
431-func (x *DropTarget) ConnectEnter(cb *func(DropTarget, float64, float64) gdk.DragAction) uint32 {439+func (x *DropTarget) ConnectEnter(cb *func(DropTarget, float64, float64) gdk.DragAction) uint {
432 cbPtr := uintptr(unsafe.Pointer(cb))440 cbPtr := uintptr(unsafe.Pointer(cb))
433 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {441 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
434- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)442+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
443+ glib.SaveHandlerMapping(handlerID, cbPtr)
444+ return handlerID
435 }445 }
436 446
437 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) gdk.DragAction {447 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) gdk.DragAction {
@@ -444,17 +454,21 @@ func (x *DropTarget) ConnectEnter(cb *func(DropTarget, float64, float64) gdk.Dra
444 }454 }
445 cbRefPtr := purego.NewCallback(fcb)455 cbRefPtr := purego.NewCallback(fcb)
446 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)456 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
447- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)457+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
458+ glib.SaveHandlerMapping(handlerID, cbPtr)
459+ return handlerID
448 }460 }
449 461
450 // Emitted on the drop site when the pointer leaves the widget.462 // Emitted on the drop site when the pointer leaves the widget.
451 //463 //
452 // Its main purpose it to undo things done in464 // Its main purpose it to undo things done in
453 // [signal@Gtk.DropTarget::enter].465 // [signal@Gtk.DropTarget::enter].
454-func (x *DropTarget) ConnectLeave(cb *func(DropTarget)) uint32 {466+func (x *DropTarget) ConnectLeave(cb *func(DropTarget)) uint {
455 cbPtr := uintptr(unsafe.Pointer(cb))467 cbPtr := uintptr(unsafe.Pointer(cb))
456 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {468 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
457- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)469+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
470+ glib.SaveHandlerMapping(handlerID, cbPtr)
471+ return handlerID
458 }472 }
459 473
460 fcb := func(clsPtr uintptr) {474 fcb := func(clsPtr uintptr) {
@@ -467,14 +481,18 @@ func (x *DropTarget) ConnectLeave(cb *func(DropTarget)) uint32 {
467 }481 }
468 cbRefPtr := purego.NewCallback(fcb)482 cbRefPtr := purego.NewCallback(fcb)
469 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)483 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
470- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)484+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
485+ glib.SaveHandlerMapping(handlerID, cbPtr)
486+ return handlerID
471 }487 }
472 488
473 // Emitted while the pointer is moving over the drop target.489 // Emitted while the pointer is moving over the drop target.
474-func (x *DropTarget) ConnectMotion(cb *func(DropTarget, float64, float64) gdk.DragAction) uint32 {490+func (x *DropTarget) ConnectMotion(cb *func(DropTarget, float64, float64) gdk.DragAction) uint {
475 cbPtr := uintptr(unsafe.Pointer(cb))491 cbPtr := uintptr(unsafe.Pointer(cb))
476 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {492 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
477- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)493+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
494+ glib.SaveHandlerMapping(handlerID, cbPtr)
495+ return handlerID
478 }496 }
479 497
480 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) gdk.DragAction {498 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) gdk.DragAction {
@@ -487,7 +505,9 @@ func (x *DropTarget) ConnectMotion(cb *func(DropTarget, float64, float64) gdk.Dr
487 }505 }
488 cbRefPtr := purego.NewCallback(fcb)506 cbRefPtr := purego.NewCallback(fcb)
489 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)507 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
490- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)508+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
509+ glib.SaveHandlerMapping(handlerID, cbPtr)
510+ return handlerID
491 }511 }
492 512
493 func init() {513 func init() {
M v4/gtk/gtkdroptargetasync.go +35 -15
@@ -182,10 +182,12 @@ func (x *DropTargetAsync) GetPropertyFormats() uintptr {
182 // further processing, such as inspecting the data, this function should182 // further processing, such as inspecting the data, this function should
183 // return %TRUE and proceed as is @drop was accepted and if it decides to183 // return %TRUE and proceed as is @drop was accepted and if it decides to
184 // reject the drop later, it should call [method@Gtk.DropTargetAsync.reject_drop].184 // reject the drop later, it should call [method@Gtk.DropTargetAsync.reject_drop].
185-func (x *DropTargetAsync) ConnectAccept(cb *func(DropTargetAsync, uintptr) bool) uint32 {185+func (x *DropTargetAsync) ConnectAccept(cb *func(DropTargetAsync, uintptr) bool) uint {
186 cbPtr := uintptr(unsafe.Pointer(cb))186 cbPtr := uintptr(unsafe.Pointer(cb))
187 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {187 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
188- return gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)188+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)
189+ glib.SaveHandlerMapping(handlerID, cbPtr)
190+ return handlerID
189 }191 }
190 192
191 fcb := func(clsPtr uintptr, DropVarp uintptr) bool {193 fcb := func(clsPtr uintptr, DropVarp uintptr) bool {
@@ -198,16 +200,20 @@ func (x *DropTargetAsync) ConnectAccept(cb *func(DropTargetAsync, uintptr) bool)
198 }200 }
199 cbRefPtr := purego.NewCallback(fcb)201 cbRefPtr := purego.NewCallback(fcb)
200 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)202 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
201- return gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)203+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept", cbRefPtr)
204+ glib.SaveHandlerMapping(handlerID, cbPtr)
205+ return handlerID
202 }206 }
203 207
204 // Emitted on the drop site when the pointer enters the widget.208 // Emitted on the drop site when the pointer enters the widget.
205 //209 //
206 // It can be used to set up custom highlighting.210 // It can be used to set up custom highlighting.
207-func (x *DropTargetAsync) ConnectDragEnter(cb *func(DropTargetAsync, uintptr, float64, float64) gdk.DragAction) uint32 {211+func (x *DropTargetAsync) ConnectDragEnter(cb *func(DropTargetAsync, uintptr, float64, float64) gdk.DragAction) uint {
208 cbPtr := uintptr(unsafe.Pointer(cb))212 cbPtr := uintptr(unsafe.Pointer(cb))
209 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {213 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
210- return gobject.SignalConnect(x.GoPointer(), "drag-enter", cbRefPtr)214+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-enter", cbRefPtr)
215+ glib.SaveHandlerMapping(handlerID, cbPtr)
216+ return handlerID
211 }217 }
212 218
213 fcb := func(clsPtr uintptr, DropVarp uintptr, XVarp float64, YVarp float64) gdk.DragAction {219 fcb := func(clsPtr uintptr, DropVarp uintptr, XVarp float64, YVarp float64) gdk.DragAction {
@@ -220,17 +226,21 @@ func (x *DropTargetAsync) ConnectDragEnter(cb *func(DropTargetAsync, uintptr, fl
220 }226 }
221 cbRefPtr := purego.NewCallback(fcb)227 cbRefPtr := purego.NewCallback(fcb)
222 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)228 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
223- return gobject.SignalConnect(x.GoPointer(), "drag-enter", cbRefPtr)229+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-enter", cbRefPtr)
230+ glib.SaveHandlerMapping(handlerID, cbPtr)
231+ return handlerID
224 }232 }
225 233
226 // Emitted on the drop site when the pointer leaves the widget.234 // Emitted on the drop site when the pointer leaves the widget.
227 //235 //
228 // Its main purpose it to undo things done in236 // Its main purpose it to undo things done in
229 // `GtkDropTargetAsync`::drag-enter.237 // `GtkDropTargetAsync`::drag-enter.
230-func (x *DropTargetAsync) ConnectDragLeave(cb *func(DropTargetAsync, uintptr)) uint32 {238+func (x *DropTargetAsync) ConnectDragLeave(cb *func(DropTargetAsync, uintptr)) uint {
231 cbPtr := uintptr(unsafe.Pointer(cb))239 cbPtr := uintptr(unsafe.Pointer(cb))
232 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {240 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
233- return gobject.SignalConnect(x.GoPointer(), "drag-leave", cbRefPtr)241+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-leave", cbRefPtr)
242+ glib.SaveHandlerMapping(handlerID, cbPtr)
243+ return handlerID
234 }244 }
235 245
236 fcb := func(clsPtr uintptr, DropVarp uintptr) {246 fcb := func(clsPtr uintptr, DropVarp uintptr) {
@@ -243,14 +253,18 @@ func (x *DropTargetAsync) ConnectDragLeave(cb *func(DropTargetAsync, uintptr)) u
243 }253 }
244 cbRefPtr := purego.NewCallback(fcb)254 cbRefPtr := purego.NewCallback(fcb)
245 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)255 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
246- return gobject.SignalConnect(x.GoPointer(), "drag-leave", cbRefPtr)256+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-leave", cbRefPtr)
257+ glib.SaveHandlerMapping(handlerID, cbPtr)
258+ return handlerID
247 }259 }
248 260
249 // Emitted while the pointer is moving over the drop target.261 // Emitted while the pointer is moving over the drop target.
250-func (x *DropTargetAsync) ConnectDragMotion(cb *func(DropTargetAsync, uintptr, float64, float64) gdk.DragAction) uint32 {262+func (x *DropTargetAsync) ConnectDragMotion(cb *func(DropTargetAsync, uintptr, float64, float64) gdk.DragAction) uint {
251 cbPtr := uintptr(unsafe.Pointer(cb))263 cbPtr := uintptr(unsafe.Pointer(cb))
252 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {264 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
253- return gobject.SignalConnect(x.GoPointer(), "drag-motion", cbRefPtr)265+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-motion", cbRefPtr)
266+ glib.SaveHandlerMapping(handlerID, cbPtr)
267+ return handlerID
254 }268 }
255 269
256 fcb := func(clsPtr uintptr, DropVarp uintptr, XVarp float64, YVarp float64) gdk.DragAction {270 fcb := func(clsPtr uintptr, DropVarp uintptr, XVarp float64, YVarp float64) gdk.DragAction {
@@ -263,7 +277,9 @@ func (x *DropTargetAsync) ConnectDragMotion(cb *func(DropTargetAsync, uintptr, f
263 }277 }
264 cbRefPtr := purego.NewCallback(fcb)278 cbRefPtr := purego.NewCallback(fcb)
265 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)279 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
266- return gobject.SignalConnect(x.GoPointer(), "drag-motion", cbRefPtr)280+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-motion", cbRefPtr)
281+ glib.SaveHandlerMapping(handlerID, cbPtr)
282+ return handlerID
267 }283 }
268 284
269 // Emitted on the drop site when the user drops the data onto the widget.285 // Emitted on the drop site when the user drops the data onto the widget.
@@ -280,10 +296,12 @@ func (x *DropTargetAsync) ConnectDragMotion(cb *func(DropTargetAsync, uintptr, f
280 // To receive the data, use one of the read functions provided by296 // To receive the data, use one of the read functions provided by
281 // [class@Gdk.Drop] such as [method@Gdk.Drop.read_async] or297 // [class@Gdk.Drop] such as [method@Gdk.Drop.read_async] or
282 // [method@Gdk.Drop.read_value_async].298 // [method@Gdk.Drop.read_value_async].
283-func (x *DropTargetAsync) ConnectDrop(cb *func(DropTargetAsync, uintptr, float64, float64) bool) uint32 {299+func (x *DropTargetAsync) ConnectDrop(cb *func(DropTargetAsync, uintptr, float64, float64) bool) uint {
284 cbPtr := uintptr(unsafe.Pointer(cb))300 cbPtr := uintptr(unsafe.Pointer(cb))
285 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {301 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
286- return gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)302+ handlerID := gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)
303+ glib.SaveHandlerMapping(handlerID, cbPtr)
304+ return handlerID
287 }305 }
288 306
289 fcb := func(clsPtr uintptr, DropVarp uintptr, XVarp float64, YVarp float64) bool {307 fcb := func(clsPtr uintptr, DropVarp uintptr, XVarp float64, YVarp float64) bool {
@@ -296,7 +314,9 @@ func (x *DropTargetAsync) ConnectDrop(cb *func(DropTargetAsync, uintptr, float64
296 }314 }
297 cbRefPtr := purego.NewCallback(fcb)315 cbRefPtr := purego.NewCallback(fcb)
298 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)316 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
299- return gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)317+ handlerID := gobject.SignalConnect(x.GoPointer(), "drop", cbRefPtr)
318+ glib.SaveHandlerMapping(handlerID, cbPtr)
319+ return handlerID
300 }320 }
301 321
302 func init() {322 func init() {
M v4/gtk/gtkemojichooser.go +7 -3
@@ -114,10 +114,12 @@ func (c *EmojiChooser) SetGoPointer(ptr uintptr) {
114 }114 }
115 115
116 // Emitted when the user selects an Emoji.116 // Emitted when the user selects an Emoji.
117-func (x *EmojiChooser) ConnectEmojiPicked(cb *func(EmojiChooser, string)) uint32 {117+func (x *EmojiChooser) ConnectEmojiPicked(cb *func(EmojiChooser, string)) uint {
118 cbPtr := uintptr(unsafe.Pointer(cb))118 cbPtr := uintptr(unsafe.Pointer(cb))
119 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {119 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
120- return gobject.SignalConnect(x.GoPointer(), "emoji-picked", cbRefPtr)120+ handlerID := gobject.SignalConnect(x.GoPointer(), "emoji-picked", cbRefPtr)
121+ glib.SaveHandlerMapping(handlerID, cbPtr)
122+ return handlerID
121 }123 }
122 124
123 fcb := func(clsPtr uintptr, TextVarp string) {125 fcb := func(clsPtr uintptr, TextVarp string) {
@@ -130,7 +132,9 @@ func (x *EmojiChooser) ConnectEmojiPicked(cb *func(EmojiChooser, string)) uint32
130 }132 }
131 cbRefPtr := purego.NewCallback(fcb)133 cbRefPtr := purego.NewCallback(fcb)
132 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)134 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
133- return gobject.SignalConnect(x.GoPointer(), "emoji-picked", cbRefPtr)135+ handlerID := gobject.SignalConnect(x.GoPointer(), "emoji-picked", cbRefPtr)
136+ glib.SaveHandlerMapping(handlerID, cbPtr)
137+ return handlerID
134 }138 }
135 139
136 // Requests the user's screen reader to announce the given message.140 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkentry.go +21 -9
@@ -1685,10 +1685,12 @@ func (x *Entry) GetPropertyVisibility() bool {
1685 // Emitted when the entry is activated.1685 // Emitted when the entry is activated.
1686 //1686 //
1687 // The keybindings for this signal are all forms of the Enter key.1687 // The keybindings for this signal are all forms of the Enter key.
1688-func (x *Entry) ConnectActivate(cb *func(Entry)) uint32 {1688+func (x *Entry) ConnectActivate(cb *func(Entry)) uint {
1689 cbPtr := uintptr(unsafe.Pointer(cb))1689 cbPtr := uintptr(unsafe.Pointer(cb))
1690 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1690 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1691- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1691+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1692+ glib.SaveHandlerMapping(handlerID, cbPtr)
1693+ return handlerID
1692 }1694 }
1693 1695
1694 fcb := func(clsPtr uintptr) {1696 fcb := func(clsPtr uintptr) {
@@ -1701,14 +1703,18 @@ func (x *Entry) ConnectActivate(cb *func(Entry)) uint32 {
1701 }1703 }
1702 cbRefPtr := purego.NewCallback(fcb)1704 cbRefPtr := purego.NewCallback(fcb)
1703 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1705 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1704- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1706+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1707+ glib.SaveHandlerMapping(handlerID, cbPtr)
1708+ return handlerID
1705 }1709 }
1706 1710
1707 // Emitted when an activatable icon is clicked.1711 // Emitted when an activatable icon is clicked.
1708-func (x *Entry) ConnectIconPress(cb *func(Entry, EntryIconPosition)) uint32 {1712+func (x *Entry) ConnectIconPress(cb *func(Entry, EntryIconPosition)) uint {
1709 cbPtr := uintptr(unsafe.Pointer(cb))1713 cbPtr := uintptr(unsafe.Pointer(cb))
1710 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1714 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1711- return gobject.SignalConnect(x.GoPointer(), "icon-press", cbRefPtr)1715+ handlerID := gobject.SignalConnect(x.GoPointer(), "icon-press", cbRefPtr)
1716+ glib.SaveHandlerMapping(handlerID, cbPtr)
1717+ return handlerID
1712 }1718 }
1713 1719
1714 fcb := func(clsPtr uintptr, IconPosVarp EntryIconPosition) {1720 fcb := func(clsPtr uintptr, IconPosVarp EntryIconPosition) {
@@ -1721,15 +1727,19 @@ func (x *Entry) ConnectIconPress(cb *func(Entry, EntryIconPosition)) uint32 {
1721 }1727 }
1722 cbRefPtr := purego.NewCallback(fcb)1728 cbRefPtr := purego.NewCallback(fcb)
1723 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1729 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1724- return gobject.SignalConnect(x.GoPointer(), "icon-press", cbRefPtr)1730+ handlerID := gobject.SignalConnect(x.GoPointer(), "icon-press", cbRefPtr)
1731+ glib.SaveHandlerMapping(handlerID, cbPtr)
1732+ return handlerID
1725 }1733 }
1726 1734
1727 // Emitted on the button release from a mouse click1735 // Emitted on the button release from a mouse click
1728 // over an activatable icon.1736 // over an activatable icon.
1729-func (x *Entry) ConnectIconRelease(cb *func(Entry, EntryIconPosition)) uint32 {1737+func (x *Entry) ConnectIconRelease(cb *func(Entry, EntryIconPosition)) uint {
1730 cbPtr := uintptr(unsafe.Pointer(cb))1738 cbPtr := uintptr(unsafe.Pointer(cb))
1731 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1739 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1732- return gobject.SignalConnect(x.GoPointer(), "icon-release", cbRefPtr)1740+ handlerID := gobject.SignalConnect(x.GoPointer(), "icon-release", cbRefPtr)
1741+ glib.SaveHandlerMapping(handlerID, cbPtr)
1742+ return handlerID
1733 }1743 }
1734 1744
1735 fcb := func(clsPtr uintptr, IconPosVarp EntryIconPosition) {1745 fcb := func(clsPtr uintptr, IconPosVarp EntryIconPosition) {
@@ -1742,7 +1752,9 @@ func (x *Entry) ConnectIconRelease(cb *func(Entry, EntryIconPosition)) uint32 {
1742 }1752 }
1743 cbRefPtr := purego.NewCallback(fcb)1753 cbRefPtr := purego.NewCallback(fcb)
1744 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1754 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1745- return gobject.SignalConnect(x.GoPointer(), "icon-release", cbRefPtr)1755+ handlerID := gobject.SignalConnect(x.GoPointer(), "icon-release", cbRefPtr)
1756+ glib.SaveHandlerMapping(handlerID, cbPtr)
1757+ return handlerID
1746 }1758 }
1747 1759
1748 // Requests the user's screen reader to announce the given message.1760 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkentrybuffer.go +14 -6
@@ -606,10 +606,12 @@ func (x *EntryBuffer) GetPropertyText() string {
606 //606 //
607 // If you want access to the text after the text has been modified,607 // If you want access to the text after the text has been modified,
608 // use %G_CONNECT_AFTER.608 // use %G_CONNECT_AFTER.
609-func (x *EntryBuffer) ConnectDeletedText(cb *func(EntryBuffer, uint, uint)) uint32 {609+func (x *EntryBuffer) ConnectDeletedText(cb *func(EntryBuffer, uint, uint)) uint {
610 cbPtr := uintptr(unsafe.Pointer(cb))610 cbPtr := uintptr(unsafe.Pointer(cb))
611 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {611 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
612- return gobject.SignalConnect(x.GoPointer(), "deleted-text", cbRefPtr)612+ handlerID := gobject.SignalConnect(x.GoPointer(), "deleted-text", cbRefPtr)
613+ glib.SaveHandlerMapping(handlerID, cbPtr)
614+ return handlerID
613 }615 }
614 616
615 fcb := func(clsPtr uintptr, PositionVarp uint, NCharsVarp uint) {617 fcb := func(clsPtr uintptr, PositionVarp uint, NCharsVarp uint) {
@@ -622,14 +624,18 @@ func (x *EntryBuffer) ConnectDeletedText(cb *func(EntryBuffer, uint, uint)) uint
622 }624 }
623 cbRefPtr := purego.NewCallback(fcb)625 cbRefPtr := purego.NewCallback(fcb)
624 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)626 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
625- return gobject.SignalConnect(x.GoPointer(), "deleted-text", cbRefPtr)627+ handlerID := gobject.SignalConnect(x.GoPointer(), "deleted-text", cbRefPtr)
628+ glib.SaveHandlerMapping(handlerID, cbPtr)
629+ return handlerID
626 }630 }
627 631
628 // This signal is emitted after text is inserted into the buffer.632 // This signal is emitted after text is inserted into the buffer.
629-func (x *EntryBuffer) ConnectInsertedText(cb *func(EntryBuffer, uint, string, uint)) uint32 {633+func (x *EntryBuffer) ConnectInsertedText(cb *func(EntryBuffer, uint, string, uint)) uint {
630 cbPtr := uintptr(unsafe.Pointer(cb))634 cbPtr := uintptr(unsafe.Pointer(cb))
631 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {635 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
632- return gobject.SignalConnect(x.GoPointer(), "inserted-text", cbRefPtr)636+ handlerID := gobject.SignalConnect(x.GoPointer(), "inserted-text", cbRefPtr)
637+ glib.SaveHandlerMapping(handlerID, cbPtr)
638+ return handlerID
633 }639 }
634 640
635 fcb := func(clsPtr uintptr, PositionVarp uint, CharsVarp string, NCharsVarp uint) {641 fcb := func(clsPtr uintptr, PositionVarp uint, CharsVarp string, NCharsVarp uint) {
@@ -642,7 +648,9 @@ func (x *EntryBuffer) ConnectInsertedText(cb *func(EntryBuffer, uint, string, ui
642 }648 }
643 cbRefPtr := purego.NewCallback(fcb)649 cbRefPtr := purego.NewCallback(fcb)
644 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)650 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
645- return gobject.SignalConnect(x.GoPointer(), "inserted-text", cbRefPtr)651+ handlerID := gobject.SignalConnect(x.GoPointer(), "inserted-text", cbRefPtr)
652+ glib.SaveHandlerMapping(handlerID, cbPtr)
653+ return handlerID
646 }654 }
647 655
648 func init() {656 func init() {
M v4/gtk/gtkentrycompletion.go +28 -12
@@ -570,10 +570,12 @@ func (x *EntryCompletion) GetPropertyTextColumn() int {
570 //570 //
571 // Note that @model is the model that was passed to571 // Note that @model is the model that was passed to
572 // [method@Gtk.EntryCompletion.set_model].572 // [method@Gtk.EntryCompletion.set_model].
573-func (x *EntryCompletion) ConnectCursorOnMatch(cb *func(EntryCompletion, uintptr, uintptr) bool) uint32 {573+func (x *EntryCompletion) ConnectCursorOnMatch(cb *func(EntryCompletion, uintptr, uintptr) bool) uint {
574 cbPtr := uintptr(unsafe.Pointer(cb))574 cbPtr := uintptr(unsafe.Pointer(cb))
575 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {575 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
576- return gobject.SignalConnect(x.GoPointer(), "cursor-on-match", cbRefPtr)576+ handlerID := gobject.SignalConnect(x.GoPointer(), "cursor-on-match", cbRefPtr)
577+ glib.SaveHandlerMapping(handlerID, cbPtr)
578+ return handlerID
577 }579 }
578 580
579 fcb := func(clsPtr uintptr, ModelVarp uintptr, IterVarp uintptr) bool {581 fcb := func(clsPtr uintptr, ModelVarp uintptr, IterVarp uintptr) bool {
@@ -586,7 +588,9 @@ func (x *EntryCompletion) ConnectCursorOnMatch(cb *func(EntryCompletion, uintptr
586 }588 }
587 cbRefPtr := purego.NewCallback(fcb)589 cbRefPtr := purego.NewCallback(fcb)
588 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)590 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
589- return gobject.SignalConnect(x.GoPointer(), "cursor-on-match", cbRefPtr)591+ handlerID := gobject.SignalConnect(x.GoPointer(), "cursor-on-match", cbRefPtr)
592+ glib.SaveHandlerMapping(handlerID, cbPtr)
593+ return handlerID
590 }594 }
591 595
592 // Emitted when the inline autocompletion is triggered.596 // Emitted when the inline autocompletion is triggered.
@@ -598,10 +602,12 @@ func (x *EntryCompletion) ConnectCursorOnMatch(cb *func(EntryCompletion, uintptr
598 // smaller part of the @prefix into the entry - e.g. the entry used in602 // smaller part of the @prefix into the entry - e.g. the entry used in
599 // the `GtkFileChooser` inserts only the part of the prefix up to the603 // the `GtkFileChooser` inserts only the part of the prefix up to the
600 // next '/'.604 // next '/'.
601-func (x *EntryCompletion) ConnectInsertPrefix(cb *func(EntryCompletion, string) bool) uint32 {605+func (x *EntryCompletion) ConnectInsertPrefix(cb *func(EntryCompletion, string) bool) uint {
602 cbPtr := uintptr(unsafe.Pointer(cb))606 cbPtr := uintptr(unsafe.Pointer(cb))
603 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {607 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
604- return gobject.SignalConnect(x.GoPointer(), "insert-prefix", cbRefPtr)608+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-prefix", cbRefPtr)
609+ glib.SaveHandlerMapping(handlerID, cbPtr)
610+ return handlerID
605 }611 }
606 612
607 fcb := func(clsPtr uintptr, PrefixVarp string) bool {613 fcb := func(clsPtr uintptr, PrefixVarp string) bool {
@@ -614,7 +620,9 @@ func (x *EntryCompletion) ConnectInsertPrefix(cb *func(EntryCompletion, string)
614 }620 }
615 cbRefPtr := purego.NewCallback(fcb)621 cbRefPtr := purego.NewCallback(fcb)
616 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)622 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
617- return gobject.SignalConnect(x.GoPointer(), "insert-prefix", cbRefPtr)623+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-prefix", cbRefPtr)
624+ glib.SaveHandlerMapping(handlerID, cbPtr)
625+ return handlerID
618 }626 }
619 627
620 // Emitted when a match from the list is selected.628 // Emitted when a match from the list is selected.
@@ -625,10 +633,12 @@ func (x *EntryCompletion) ConnectInsertPrefix(cb *func(EntryCompletion, string)
625 //633 //
626 // Note that @model is the model that was passed to634 // Note that @model is the model that was passed to
627 // [method@Gtk.EntryCompletion.set_model].635 // [method@Gtk.EntryCompletion.set_model].
628-func (x *EntryCompletion) ConnectMatchSelected(cb *func(EntryCompletion, uintptr, uintptr) bool) uint32 {636+func (x *EntryCompletion) ConnectMatchSelected(cb *func(EntryCompletion, uintptr, uintptr) bool) uint {
629 cbPtr := uintptr(unsafe.Pointer(cb))637 cbPtr := uintptr(unsafe.Pointer(cb))
630 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {638 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
631- return gobject.SignalConnect(x.GoPointer(), "match-selected", cbRefPtr)639+ handlerID := gobject.SignalConnect(x.GoPointer(), "match-selected", cbRefPtr)
640+ glib.SaveHandlerMapping(handlerID, cbPtr)
641+ return handlerID
632 }642 }
633 643
634 fcb := func(clsPtr uintptr, ModelVarp uintptr, IterVarp uintptr) bool {644 fcb := func(clsPtr uintptr, ModelVarp uintptr, IterVarp uintptr) bool {
@@ -641,17 +651,21 @@ func (x *EntryCompletion) ConnectMatchSelected(cb *func(EntryCompletion, uintptr
641 }651 }
642 cbRefPtr := purego.NewCallback(fcb)652 cbRefPtr := purego.NewCallback(fcb)
643 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)653 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
644- return gobject.SignalConnect(x.GoPointer(), "match-selected", cbRefPtr)654+ handlerID := gobject.SignalConnect(x.GoPointer(), "match-selected", cbRefPtr)
655+ glib.SaveHandlerMapping(handlerID, cbPtr)
656+ return handlerID
645 }657 }
646 658
647 // Emitted when the filter model has zero659 // Emitted when the filter model has zero
648 // number of rows in completion_complete method.660 // number of rows in completion_complete method.
649 //661 //
650 // In other words when `GtkEntryCompletion` is out of suggestions.662 // In other words when `GtkEntryCompletion` is out of suggestions.
651-func (x *EntryCompletion) ConnectNoMatches(cb *func(EntryCompletion)) uint32 {663+func (x *EntryCompletion) ConnectNoMatches(cb *func(EntryCompletion)) uint {
652 cbPtr := uintptr(unsafe.Pointer(cb))664 cbPtr := uintptr(unsafe.Pointer(cb))
653 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {665 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
654- return gobject.SignalConnect(x.GoPointer(), "no-matches", cbRefPtr)666+ handlerID := gobject.SignalConnect(x.GoPointer(), "no-matches", cbRefPtr)
667+ glib.SaveHandlerMapping(handlerID, cbPtr)
668+ return handlerID
655 }669 }
656 670
657 fcb := func(clsPtr uintptr) {671 fcb := func(clsPtr uintptr) {
@@ -664,7 +678,9 @@ func (x *EntryCompletion) ConnectNoMatches(cb *func(EntryCompletion)) uint32 {
664 }678 }
665 cbRefPtr := purego.NewCallback(fcb)679 cbRefPtr := purego.NewCallback(fcb)
666 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)680 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
667- return gobject.SignalConnect(x.GoPointer(), "no-matches", cbRefPtr)681+ handlerID := gobject.SignalConnect(x.GoPointer(), "no-matches", cbRefPtr)
682+ glib.SaveHandlerMapping(handlerID, cbPtr)
683+ return handlerID
668 }684 }
669 685
670 // Gets the ID of the @buildable object.686 // Gets the ID of the @buildable object.
M v4/gtk/gtkeventcontrollerfocus.go +14 -6
@@ -131,10 +131,12 @@ func (x *EventControllerFocus) GetPropertyIsFocus() bool {
131 // in these cases, you can monitor the131 // in these cases, you can monitor the
132 // [property@Gtk.EventControllerFocus:is-focus]132 // [property@Gtk.EventControllerFocus:is-focus]
133 // property for changes.133 // property for changes.
134-func (x *EventControllerFocus) ConnectEnter(cb *func(EventControllerFocus)) uint32 {134+func (x *EventControllerFocus) ConnectEnter(cb *func(EventControllerFocus)) uint {
135 cbPtr := uintptr(unsafe.Pointer(cb))135 cbPtr := uintptr(unsafe.Pointer(cb))
136 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {136 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
137- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)137+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
138+ glib.SaveHandlerMapping(handlerID, cbPtr)
139+ return handlerID
138 }140 }
139 141
140 fcb := func(clsPtr uintptr) {142 fcb := func(clsPtr uintptr) {
@@ -147,7 +149,9 @@ func (x *EventControllerFocus) ConnectEnter(cb *func(EventControllerFocus)) uint
147 }149 }
148 cbRefPtr := purego.NewCallback(fcb)150 cbRefPtr := purego.NewCallback(fcb)
149 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)151 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
150- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)152+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
153+ glib.SaveHandlerMapping(handlerID, cbPtr)
154+ return handlerID
151 }155 }
152 156
153 // Emitted whenever the focus leaves the widget hierarchy157 // Emitted whenever the focus leaves the widget hierarchy
@@ -159,10 +163,12 @@ func (x *EventControllerFocus) ConnectEnter(cb *func(EventControllerFocus)) uint
159 // to a descendent). If you are interested in these cases, you163 // to a descendent). If you are interested in these cases, you
160 // can monitor the [property@Gtk.EventControllerFocus:is-focus]164 // can monitor the [property@Gtk.EventControllerFocus:is-focus]
161 // property for changes.165 // property for changes.
162-func (x *EventControllerFocus) ConnectLeave(cb *func(EventControllerFocus)) uint32 {166+func (x *EventControllerFocus) ConnectLeave(cb *func(EventControllerFocus)) uint {
163 cbPtr := uintptr(unsafe.Pointer(cb))167 cbPtr := uintptr(unsafe.Pointer(cb))
164 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {168 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
165- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)169+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
170+ glib.SaveHandlerMapping(handlerID, cbPtr)
171+ return handlerID
166 }172 }
167 173
168 fcb := func(clsPtr uintptr) {174 fcb := func(clsPtr uintptr) {
@@ -175,7 +181,9 @@ func (x *EventControllerFocus) ConnectLeave(cb *func(EventControllerFocus)) uint
175 }181 }
176 cbRefPtr := purego.NewCallback(fcb)182 cbRefPtr := purego.NewCallback(fcb)
177 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)183 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
178- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)184+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
185+ glib.SaveHandlerMapping(handlerID, cbPtr)
186+ return handlerID
179 }187 }
180 188
181 func init() {189 func init() {
M v4/gtk/gtkeventcontrollerkey.go +28 -12
@@ -123,10 +123,12 @@ func (c *EventControllerKey) SetGoPointer(ptr uintptr) {
123 //123 //
124 // See [method@Gtk.EventControllerKey.set_im_context] and124 // See [method@Gtk.EventControllerKey.set_im_context] and
125 // [method@Gtk.IMContext.filter_keypress].125 // [method@Gtk.IMContext.filter_keypress].
126-func (x *EventControllerKey) ConnectImUpdate(cb *func(EventControllerKey)) uint32 {126+func (x *EventControllerKey) ConnectImUpdate(cb *func(EventControllerKey)) uint {
127 cbPtr := uintptr(unsafe.Pointer(cb))127 cbPtr := uintptr(unsafe.Pointer(cb))
128 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {128 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
129- return gobject.SignalConnect(x.GoPointer(), "im-update", cbRefPtr)129+ handlerID := gobject.SignalConnect(x.GoPointer(), "im-update", cbRefPtr)
130+ glib.SaveHandlerMapping(handlerID, cbPtr)
131+ return handlerID
130 }132 }
131 133
132 fcb := func(clsPtr uintptr) {134 fcb := func(clsPtr uintptr) {
@@ -139,14 +141,18 @@ func (x *EventControllerKey) ConnectImUpdate(cb *func(EventControllerKey)) uint3
139 }141 }
140 cbRefPtr := purego.NewCallback(fcb)142 cbRefPtr := purego.NewCallback(fcb)
141 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)143 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
142- return gobject.SignalConnect(x.GoPointer(), "im-update", cbRefPtr)144+ handlerID := gobject.SignalConnect(x.GoPointer(), "im-update", cbRefPtr)
145+ glib.SaveHandlerMapping(handlerID, cbPtr)
146+ return handlerID
143 }147 }
144 148
145 // Emitted whenever a key is pressed.149 // Emitted whenever a key is pressed.
146-func (x *EventControllerKey) ConnectKeyPressed(cb *func(EventControllerKey, uint, uint, gdk.ModifierType) bool) uint32 {150+func (x *EventControllerKey) ConnectKeyPressed(cb *func(EventControllerKey, uint, uint, gdk.ModifierType) bool) uint {
147 cbPtr := uintptr(unsafe.Pointer(cb))151 cbPtr := uintptr(unsafe.Pointer(cb))
148 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {152 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
149- return gobject.SignalConnect(x.GoPointer(), "key-pressed", cbRefPtr)153+ handlerID := gobject.SignalConnect(x.GoPointer(), "key-pressed", cbRefPtr)
154+ glib.SaveHandlerMapping(handlerID, cbPtr)
155+ return handlerID
150 }156 }
151 157
152 fcb := func(clsPtr uintptr, KeyvalVarp uint, KeycodeVarp uint, StateVarp gdk.ModifierType) bool {158 fcb := func(clsPtr uintptr, KeyvalVarp uint, KeycodeVarp uint, StateVarp gdk.ModifierType) bool {
@@ -159,14 +165,18 @@ func (x *EventControllerKey) ConnectKeyPressed(cb *func(EventControllerKey, uint
159 }165 }
160 cbRefPtr := purego.NewCallback(fcb)166 cbRefPtr := purego.NewCallback(fcb)
161 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)167 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
162- return gobject.SignalConnect(x.GoPointer(), "key-pressed", cbRefPtr)168+ handlerID := gobject.SignalConnect(x.GoPointer(), "key-pressed", cbRefPtr)
169+ glib.SaveHandlerMapping(handlerID, cbPtr)
170+ return handlerID
163 }171 }
164 172
165 // Emitted whenever a key is released.173 // Emitted whenever a key is released.
166-func (x *EventControllerKey) ConnectKeyReleased(cb *func(EventControllerKey, uint, uint, gdk.ModifierType)) uint32 {174+func (x *EventControllerKey) ConnectKeyReleased(cb *func(EventControllerKey, uint, uint, gdk.ModifierType)) uint {
167 cbPtr := uintptr(unsafe.Pointer(cb))175 cbPtr := uintptr(unsafe.Pointer(cb))
168 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {176 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
169- return gobject.SignalConnect(x.GoPointer(), "key-released", cbRefPtr)177+ handlerID := gobject.SignalConnect(x.GoPointer(), "key-released", cbRefPtr)
178+ glib.SaveHandlerMapping(handlerID, cbPtr)
179+ return handlerID
170 }180 }
171 181
172 fcb := func(clsPtr uintptr, KeyvalVarp uint, KeycodeVarp uint, StateVarp gdk.ModifierType) {182 fcb := func(clsPtr uintptr, KeyvalVarp uint, KeycodeVarp uint, StateVarp gdk.ModifierType) {
@@ -179,14 +189,18 @@ func (x *EventControllerKey) ConnectKeyReleased(cb *func(EventControllerKey, uin
179 }189 }
180 cbRefPtr := purego.NewCallback(fcb)190 cbRefPtr := purego.NewCallback(fcb)
181 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)191 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
182- return gobject.SignalConnect(x.GoPointer(), "key-released", cbRefPtr)192+ handlerID := gobject.SignalConnect(x.GoPointer(), "key-released", cbRefPtr)
193+ glib.SaveHandlerMapping(handlerID, cbPtr)
194+ return handlerID
183 }195 }
184 196
185 // Emitted whenever the state of modifier keys and pointer buttons change.197 // Emitted whenever the state of modifier keys and pointer buttons change.
186-func (x *EventControllerKey) ConnectModifiers(cb *func(EventControllerKey, gdk.ModifierType) bool) uint32 {198+func (x *EventControllerKey) ConnectModifiers(cb *func(EventControllerKey, gdk.ModifierType) bool) uint {
187 cbPtr := uintptr(unsafe.Pointer(cb))199 cbPtr := uintptr(unsafe.Pointer(cb))
188 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {200 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
189- return gobject.SignalConnect(x.GoPointer(), "modifiers", cbRefPtr)201+ handlerID := gobject.SignalConnect(x.GoPointer(), "modifiers", cbRefPtr)
202+ glib.SaveHandlerMapping(handlerID, cbPtr)
203+ return handlerID
190 }204 }
191 205
192 fcb := func(clsPtr uintptr, StateVarp gdk.ModifierType) bool {206 fcb := func(clsPtr uintptr, StateVarp gdk.ModifierType) bool {
@@ -199,7 +213,9 @@ func (x *EventControllerKey) ConnectModifiers(cb *func(EventControllerKey, gdk.M
199 }213 }
200 cbRefPtr := purego.NewCallback(fcb)214 cbRefPtr := purego.NewCallback(fcb)
201 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)215 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
202- return gobject.SignalConnect(x.GoPointer(), "modifiers", cbRefPtr)216+ handlerID := gobject.SignalConnect(x.GoPointer(), "modifiers", cbRefPtr)
217+ glib.SaveHandlerMapping(handlerID, cbPtr)
218+ return handlerID
203 }219 }
204 220
205 func init() {221 func init() {
M v4/gtk/gtkeventcontrollerlegacy.go +7 -3
@@ -68,10 +68,12 @@ func (c *EventControllerLegacy) SetGoPointer(ptr uintptr) {
68 }68 }
69 69
70 // Emitted for each GDK event delivered to @controller.70 // Emitted for each GDK event delivered to @controller.
71-func (x *EventControllerLegacy) ConnectEvent(cb *func(EventControllerLegacy, uintptr) bool) uint32 {71+func (x *EventControllerLegacy) ConnectEvent(cb *func(EventControllerLegacy, uintptr) bool) uint {
72 cbPtr := uintptr(unsafe.Pointer(cb))72 cbPtr := uintptr(unsafe.Pointer(cb))
73 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {73 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
74- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)74+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
75+ glib.SaveHandlerMapping(handlerID, cbPtr)
76+ return handlerID
75 }77 }
76 78
77 fcb := func(clsPtr uintptr, EventVarp uintptr) bool {79 fcb := func(clsPtr uintptr, EventVarp uintptr) bool {
@@ -84,7 +86,9 @@ func (x *EventControllerLegacy) ConnectEvent(cb *func(EventControllerLegacy, uin
84 }86 }
85 cbRefPtr := purego.NewCallback(fcb)87 cbRefPtr := purego.NewCallback(fcb)
86 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)88 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
87- return gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)89+ handlerID := gobject.SignalConnect(x.GoPointer(), "event", cbRefPtr)
90+ glib.SaveHandlerMapping(handlerID, cbPtr)
91+ return handlerID
88 }92 }
89 93
90 func init() {94 func init() {
M v4/gtk/gtkeventcontrollermotion.go +21 -9
@@ -121,10 +121,12 @@ func (x *EventControllerMotion) GetPropertyIsPointer() bool {
121 }121 }
122 122
123 // Signals that the pointer has entered the widget.123 // Signals that the pointer has entered the widget.
124-func (x *EventControllerMotion) ConnectEnter(cb *func(EventControllerMotion, float64, float64)) uint32 {124+func (x *EventControllerMotion) ConnectEnter(cb *func(EventControllerMotion, float64, float64)) uint {
125 cbPtr := uintptr(unsafe.Pointer(cb))125 cbPtr := uintptr(unsafe.Pointer(cb))
126 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {126 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
127- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)127+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
128+ glib.SaveHandlerMapping(handlerID, cbPtr)
129+ return handlerID
128 }130 }
129 131
130 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {132 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -137,14 +139,18 @@ func (x *EventControllerMotion) ConnectEnter(cb *func(EventControllerMotion, flo
137 }139 }
138 cbRefPtr := purego.NewCallback(fcb)140 cbRefPtr := purego.NewCallback(fcb)
139 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)141 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
140- return gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)142+ handlerID := gobject.SignalConnect(x.GoPointer(), "enter", cbRefPtr)
143+ glib.SaveHandlerMapping(handlerID, cbPtr)
144+ return handlerID
141 }145 }
142 146
143 // Signals that the pointer has left the widget.147 // Signals that the pointer has left the widget.
144-func (x *EventControllerMotion) ConnectLeave(cb *func(EventControllerMotion)) uint32 {148+func (x *EventControllerMotion) ConnectLeave(cb *func(EventControllerMotion)) uint {
145 cbPtr := uintptr(unsafe.Pointer(cb))149 cbPtr := uintptr(unsafe.Pointer(cb))
146 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {150 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
147- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)151+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
152+ glib.SaveHandlerMapping(handlerID, cbPtr)
153+ return handlerID
148 }154 }
149 155
150 fcb := func(clsPtr uintptr) {156 fcb := func(clsPtr uintptr) {
@@ -157,14 +163,18 @@ func (x *EventControllerMotion) ConnectLeave(cb *func(EventControllerMotion)) ui
157 }163 }
158 cbRefPtr := purego.NewCallback(fcb)164 cbRefPtr := purego.NewCallback(fcb)
159 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)165 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
160- return gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)166+ handlerID := gobject.SignalConnect(x.GoPointer(), "leave", cbRefPtr)
167+ glib.SaveHandlerMapping(handlerID, cbPtr)
168+ return handlerID
161 }169 }
162 170
163 // Emitted when the pointer moves inside the widget.171 // Emitted when the pointer moves inside the widget.
164-func (x *EventControllerMotion) ConnectMotion(cb *func(EventControllerMotion, float64, float64)) uint32 {172+func (x *EventControllerMotion) ConnectMotion(cb *func(EventControllerMotion, float64, float64)) uint {
165 cbPtr := uintptr(unsafe.Pointer(cb))173 cbPtr := uintptr(unsafe.Pointer(cb))
166 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {174 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
167- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)175+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
176+ glib.SaveHandlerMapping(handlerID, cbPtr)
177+ return handlerID
168 }178 }
169 179
170 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {180 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -177,7 +187,9 @@ func (x *EventControllerMotion) ConnectMotion(cb *func(EventControllerMotion, fl
177 }187 }
178 cbRefPtr := purego.NewCallback(fcb)188 cbRefPtr := purego.NewCallback(fcb)
179 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)189 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
180- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)190+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
191+ glib.SaveHandlerMapping(handlerID, cbPtr)
192+ return handlerID
181 }193 }
182 194
183 func init() {195 func init() {
M v4/gtk/gtkeventcontrollerscroll.go +28 -12
@@ -164,10 +164,12 @@ func (c *EventControllerScroll) SetGoPointer(ptr uintptr) {
164 // @vel_x and @vel_y express the initial velocity that was164 // @vel_x and @vel_y express the initial velocity that was
165 // imprinted by the scroll events. @vel_x and @vel_y are expressed in165 // imprinted by the scroll events. @vel_x and @vel_y are expressed in
166 // pixels/ms.166 // pixels/ms.
167-func (x *EventControllerScroll) ConnectDecelerate(cb *func(EventControllerScroll, float64, float64)) uint32 {167+func (x *EventControllerScroll) ConnectDecelerate(cb *func(EventControllerScroll, float64, float64)) uint {
168 cbPtr := uintptr(unsafe.Pointer(cb))168 cbPtr := uintptr(unsafe.Pointer(cb))
169 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {169 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
170- return gobject.SignalConnect(x.GoPointer(), "decelerate", cbRefPtr)170+ handlerID := gobject.SignalConnect(x.GoPointer(), "decelerate", cbRefPtr)
171+ glib.SaveHandlerMapping(handlerID, cbPtr)
172+ return handlerID
171 }173 }
172 174
173 fcb := func(clsPtr uintptr, VelXVarp float64, VelYVarp float64) {175 fcb := func(clsPtr uintptr, VelXVarp float64, VelYVarp float64) {
@@ -180,7 +182,9 @@ func (x *EventControllerScroll) ConnectDecelerate(cb *func(EventControllerScroll
180 }182 }
181 cbRefPtr := purego.NewCallback(fcb)183 cbRefPtr := purego.NewCallback(fcb)
182 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)184 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
183- return gobject.SignalConnect(x.GoPointer(), "decelerate", cbRefPtr)185+ handlerID := gobject.SignalConnect(x.GoPointer(), "decelerate", cbRefPtr)
186+ glib.SaveHandlerMapping(handlerID, cbPtr)
187+ return handlerID
184 }188 }
185 189
186 // Signals that the widget should scroll by the190 // Signals that the widget should scroll by the
@@ -188,10 +192,12 @@ func (x *EventControllerScroll) ConnectDecelerate(cb *func(EventControllerScroll
188 //192 //
189 // For the representation unit of the deltas, see193 // For the representation unit of the deltas, see
190 // [method@Gtk.EventControllerScroll.get_unit].194 // [method@Gtk.EventControllerScroll.get_unit].
191-func (x *EventControllerScroll) ConnectScroll(cb *func(EventControllerScroll, float64, float64) bool) uint32 {195+func (x *EventControllerScroll) ConnectScroll(cb *func(EventControllerScroll, float64, float64) bool) uint {
192 cbPtr := uintptr(unsafe.Pointer(cb))196 cbPtr := uintptr(unsafe.Pointer(cb))
193 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {197 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
194- return gobject.SignalConnect(x.GoPointer(), "scroll", cbRefPtr)198+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll", cbRefPtr)
199+ glib.SaveHandlerMapping(handlerID, cbPtr)
200+ return handlerID
195 }201 }
196 202
197 fcb := func(clsPtr uintptr, DxVarp float64, DyVarp float64) bool {203 fcb := func(clsPtr uintptr, DxVarp float64, DyVarp float64) bool {
@@ -204,16 +210,20 @@ func (x *EventControllerScroll) ConnectScroll(cb *func(EventControllerScroll, fl
204 }210 }
205 cbRefPtr := purego.NewCallback(fcb)211 cbRefPtr := purego.NewCallback(fcb)
206 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)212 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
207- return gobject.SignalConnect(x.GoPointer(), "scroll", cbRefPtr)213+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll", cbRefPtr)
214+ glib.SaveHandlerMapping(handlerID, cbPtr)
215+ return handlerID
208 }216 }
209 217
210 // Signals that a new scrolling operation has begun.218 // Signals that a new scrolling operation has begun.
211 //219 //
212 // It will only be emitted on devices capable of it.220 // It will only be emitted on devices capable of it.
213-func (x *EventControllerScroll) ConnectScrollBegin(cb *func(EventControllerScroll)) uint32 {221+func (x *EventControllerScroll) ConnectScrollBegin(cb *func(EventControllerScroll)) uint {
214 cbPtr := uintptr(unsafe.Pointer(cb))222 cbPtr := uintptr(unsafe.Pointer(cb))
215 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {223 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
216- return gobject.SignalConnect(x.GoPointer(), "scroll-begin", cbRefPtr)224+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll-begin", cbRefPtr)
225+ glib.SaveHandlerMapping(handlerID, cbPtr)
226+ return handlerID
217 }227 }
218 228
219 fcb := func(clsPtr uintptr) {229 fcb := func(clsPtr uintptr) {
@@ -226,16 +236,20 @@ func (x *EventControllerScroll) ConnectScrollBegin(cb *func(EventControllerScrol
226 }236 }
227 cbRefPtr := purego.NewCallback(fcb)237 cbRefPtr := purego.NewCallback(fcb)
228 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)238 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
229- return gobject.SignalConnect(x.GoPointer(), "scroll-begin", cbRefPtr)239+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll-begin", cbRefPtr)
240+ glib.SaveHandlerMapping(handlerID, cbPtr)
241+ return handlerID
230 }242 }
231 243
232 // Signals that a scrolling operation has finished.244 // Signals that a scrolling operation has finished.
233 //245 //
234 // It will only be emitted on devices capable of it.246 // It will only be emitted on devices capable of it.
235-func (x *EventControllerScroll) ConnectScrollEnd(cb *func(EventControllerScroll)) uint32 {247+func (x *EventControllerScroll) ConnectScrollEnd(cb *func(EventControllerScroll)) uint {
236 cbPtr := uintptr(unsafe.Pointer(cb))248 cbPtr := uintptr(unsafe.Pointer(cb))
237 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {249 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
238- return gobject.SignalConnect(x.GoPointer(), "scroll-end", cbRefPtr)250+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll-end", cbRefPtr)
251+ glib.SaveHandlerMapping(handlerID, cbPtr)
252+ return handlerID
239 }253 }
240 254
241 fcb := func(clsPtr uintptr) {255 fcb := func(clsPtr uintptr) {
@@ -248,7 +262,9 @@ func (x *EventControllerScroll) ConnectScrollEnd(cb *func(EventControllerScroll)
248 }262 }
249 cbRefPtr := purego.NewCallback(fcb)263 cbRefPtr := purego.NewCallback(fcb)
250 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)264 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
251- return gobject.SignalConnect(x.GoPointer(), "scroll-end", cbRefPtr)265+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll-end", cbRefPtr)
266+ glib.SaveHandlerMapping(handlerID, cbPtr)
267+ return handlerID
252 }268 }
253 269
254 func init() {270 func init() {
M v4/gtk/gtkexpander.go +7 -3
@@ -444,10 +444,12 @@ func (x *Expander) GetPropertyUseUnderline() bool {
444 }444 }
445 445
446 // Activates the `GtkExpander`.446 // Activates the `GtkExpander`.
447-func (x *Expander) ConnectActivate(cb *func(Expander)) uint32 {447+func (x *Expander) ConnectActivate(cb *func(Expander)) uint {
448 cbPtr := uintptr(unsafe.Pointer(cb))448 cbPtr := uintptr(unsafe.Pointer(cb))
449 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {449 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
450- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)450+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
451+ glib.SaveHandlerMapping(handlerID, cbPtr)
452+ return handlerID
451 }453 }
452 454
453 fcb := func(clsPtr uintptr) {455 fcb := func(clsPtr uintptr) {
@@ -460,7 +462,9 @@ func (x *Expander) ConnectActivate(cb *func(Expander)) uint32 {
460 }462 }
461 cbRefPtr := purego.NewCallback(fcb)463 cbRefPtr := purego.NewCallback(fcb)
462 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)464 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
463- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)465+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
466+ glib.SaveHandlerMapping(handlerID, cbPtr)
467+ return handlerID
464 }468 }
465 469
466 // Requests the user's screen reader to announce the given message.470 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkfilechooserwidget.go +84 -36
@@ -131,10 +131,12 @@ func (x *FileChooserWidget) GetPropertySubtitle() string {
131 // folder in the file list.131 // folder in the file list.
132 //132 //
133 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;D&lt;/kbd&gt;.133 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;D&lt;/kbd&gt;.
134-func (x *FileChooserWidget) ConnectDesktopFolder(cb *func(FileChooserWidget)) uint32 {134+func (x *FileChooserWidget) ConnectDesktopFolder(cb *func(FileChooserWidget)) uint {
135 cbPtr := uintptr(unsafe.Pointer(cb))135 cbPtr := uintptr(unsafe.Pointer(cb))
136 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {136 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
137- return gobject.SignalConnect(x.GoPointer(), "desktop-folder", cbRefPtr)137+ handlerID := gobject.SignalConnect(x.GoPointer(), "desktop-folder", cbRefPtr)
138+ glib.SaveHandlerMapping(handlerID, cbPtr)
139+ return handlerID
138 }140 }
139 141
140 fcb := func(clsPtr uintptr) {142 fcb := func(clsPtr uintptr) {
@@ -147,7 +149,9 @@ func (x *FileChooserWidget) ConnectDesktopFolder(cb *func(FileChooserWidget)) ui
147 }149 }
148 cbRefPtr := purego.NewCallback(fcb)150 cbRefPtr := purego.NewCallback(fcb)
149 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)151 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
150- return gobject.SignalConnect(x.GoPointer(), "desktop-folder", cbRefPtr)152+ handlerID := gobject.SignalConnect(x.GoPointer(), "desktop-folder", cbRefPtr)
153+ glib.SaveHandlerMapping(handlerID, cbPtr)
154+ return handlerID
151 }155 }
152 156
153 // Emitted when the user asks for it.157 // Emitted when the user asks for it.
@@ -162,10 +166,12 @@ func (x *FileChooserWidget) ConnectDesktopFolder(cb *func(FileChooserWidget)) ui
162 // switch to the "baz" subfolder.166 // switch to the "baz" subfolder.
163 //167 //
164 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Down&lt;/kbd&gt;.168 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Down&lt;/kbd&gt;.
165-func (x *FileChooserWidget) ConnectDownFolder(cb *func(FileChooserWidget)) uint32 {169+func (x *FileChooserWidget) ConnectDownFolder(cb *func(FileChooserWidget)) uint {
166 cbPtr := uintptr(unsafe.Pointer(cb))170 cbPtr := uintptr(unsafe.Pointer(cb))
167 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {171 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
168- return gobject.SignalConnect(x.GoPointer(), "down-folder", cbRefPtr)172+ handlerID := gobject.SignalConnect(x.GoPointer(), "down-folder", cbRefPtr)
173+ glib.SaveHandlerMapping(handlerID, cbPtr)
174+ return handlerID
169 }175 }
170 176
171 fcb := func(clsPtr uintptr) {177 fcb := func(clsPtr uintptr) {
@@ -178,7 +184,9 @@ func (x *FileChooserWidget) ConnectDownFolder(cb *func(FileChooserWidget)) uint3
178 }184 }
179 cbRefPtr := purego.NewCallback(fcb)185 cbRefPtr := purego.NewCallback(fcb)
180 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)186 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
181- return gobject.SignalConnect(x.GoPointer(), "down-folder", cbRefPtr)187+ handlerID := gobject.SignalConnect(x.GoPointer(), "down-folder", cbRefPtr)
188+ glib.SaveHandlerMapping(handlerID, cbPtr)
189+ return handlerID
182 }190 }
183 191
184 // Emitted when the user asks for it.192 // Emitted when the user asks for it.
@@ -189,10 +197,12 @@ func (x *FileChooserWidget) ConnectDownFolder(cb *func(FileChooserWidget)) uint3
189 // folder in the file list.197 // folder in the file list.
190 //198 //
191 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Home&lt;/kbd&gt;.199 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Home&lt;/kbd&gt;.
192-func (x *FileChooserWidget) ConnectHomeFolder(cb *func(FileChooserWidget)) uint32 {200+func (x *FileChooserWidget) ConnectHomeFolder(cb *func(FileChooserWidget)) uint {
193 cbPtr := uintptr(unsafe.Pointer(cb))201 cbPtr := uintptr(unsafe.Pointer(cb))
194 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {202 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
195- return gobject.SignalConnect(x.GoPointer(), "home-folder", cbRefPtr)203+ handlerID := gobject.SignalConnect(x.GoPointer(), "home-folder", cbRefPtr)
204+ glib.SaveHandlerMapping(handlerID, cbPtr)
205+ return handlerID
196 }206 }
197 207
198 fcb := func(clsPtr uintptr) {208 fcb := func(clsPtr uintptr) {
@@ -205,7 +215,9 @@ func (x *FileChooserWidget) ConnectHomeFolder(cb *func(FileChooserWidget)) uint3
205 }215 }
206 cbRefPtr := purego.NewCallback(fcb)216 cbRefPtr := purego.NewCallback(fcb)
207 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)217 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
208- return gobject.SignalConnect(x.GoPointer(), "home-folder", cbRefPtr)218+ handlerID := gobject.SignalConnect(x.GoPointer(), "home-folder", cbRefPtr)
219+ glib.SaveHandlerMapping(handlerID, cbPtr)
220+ return handlerID
209 }221 }
210 222
211 // Emitted when the user asks for it.223 // Emitted when the user asks for it.
@@ -221,10 +233,12 @@ func (x *FileChooserWidget) ConnectHomeFolder(cb *func(FileChooserWidget)) uint3
221 // type `/` and immediately type a path name. On Unix systems, this is233 // type `/` and immediately type a path name. On Unix systems, this is
222 // bound to &lt;kbd&gt;~&lt;/kbd&gt; (tilde) with a @path string of "~" itself for234 // bound to &lt;kbd&gt;~&lt;/kbd&gt; (tilde) with a @path string of "~" itself for
223 // access to home directories.235 // access to home directories.
224-func (x *FileChooserWidget) ConnectLocationPopup(cb *func(FileChooserWidget, string)) uint32 {236+func (x *FileChooserWidget) ConnectLocationPopup(cb *func(FileChooserWidget, string)) uint {
225 cbPtr := uintptr(unsafe.Pointer(cb))237 cbPtr := uintptr(unsafe.Pointer(cb))
226 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {238 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
227- return gobject.SignalConnect(x.GoPointer(), "location-popup", cbRefPtr)239+ handlerID := gobject.SignalConnect(x.GoPointer(), "location-popup", cbRefPtr)
240+ glib.SaveHandlerMapping(handlerID, cbPtr)
241+ return handlerID
228 }242 }
229 243
230 fcb := func(clsPtr uintptr, PathVarp string) {244 fcb := func(clsPtr uintptr, PathVarp string) {
@@ -237,7 +251,9 @@ func (x *FileChooserWidget) ConnectLocationPopup(cb *func(FileChooserWidget, str
237 }251 }
238 cbRefPtr := purego.NewCallback(fcb)252 cbRefPtr := purego.NewCallback(fcb)
239 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)253 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
240- return gobject.SignalConnect(x.GoPointer(), "location-popup", cbRefPtr)254+ handlerID := gobject.SignalConnect(x.GoPointer(), "location-popup", cbRefPtr)
255+ glib.SaveHandlerMapping(handlerID, cbPtr)
256+ return handlerID
241 }257 }
242 258
243 // Emitted when the user asks for it.259 // Emitted when the user asks for it.
@@ -248,10 +264,12 @@ func (x *FileChooserWidget) ConnectLocationPopup(cb *func(FileChooserWidget, str
248 // when the user pastes into a `GtkFileChooserWidget`.264 // when the user pastes into a `GtkFileChooserWidget`.
249 //265 //
250 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;V&lt;/kbd&gt;.266 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;V&lt;/kbd&gt;.
251-func (x *FileChooserWidget) ConnectLocationPopupOnPaste(cb *func(FileChooserWidget)) uint32 {267+func (x *FileChooserWidget) ConnectLocationPopupOnPaste(cb *func(FileChooserWidget)) uint {
252 cbPtr := uintptr(unsafe.Pointer(cb))268 cbPtr := uintptr(unsafe.Pointer(cb))
253 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {269 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
254- return gobject.SignalConnect(x.GoPointer(), "location-popup-on-paste", cbRefPtr)270+ handlerID := gobject.SignalConnect(x.GoPointer(), "location-popup-on-paste", cbRefPtr)
271+ glib.SaveHandlerMapping(handlerID, cbPtr)
272+ return handlerID
255 }273 }
256 274
257 fcb := func(clsPtr uintptr) {275 fcb := func(clsPtr uintptr) {
@@ -264,7 +282,9 @@ func (x *FileChooserWidget) ConnectLocationPopupOnPaste(cb *func(FileChooserWidg
264 }282 }
265 cbRefPtr := purego.NewCallback(fcb)283 cbRefPtr := purego.NewCallback(fcb)
266 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)284 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
267- return gobject.SignalConnect(x.GoPointer(), "location-popup-on-paste", cbRefPtr)285+ handlerID := gobject.SignalConnect(x.GoPointer(), "location-popup-on-paste", cbRefPtr)
286+ glib.SaveHandlerMapping(handlerID, cbPtr)
287+ return handlerID
268 }288 }
269 289
270 // Emitted when the user asks for it.290 // Emitted when the user asks for it.
@@ -276,10 +296,12 @@ func (x *FileChooserWidget) ConnectLocationPopupOnPaste(cb *func(FileChooserWidg
276 // he wishes to select.296 // he wishes to select.
277 //297 //
278 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;L&lt;/kbd&gt;.298 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;L&lt;/kbd&gt;.
279-func (x *FileChooserWidget) ConnectLocationTogglePopup(cb *func(FileChooserWidget)) uint32 {299+func (x *FileChooserWidget) ConnectLocationTogglePopup(cb *func(FileChooserWidget)) uint {
280 cbPtr := uintptr(unsafe.Pointer(cb))300 cbPtr := uintptr(unsafe.Pointer(cb))
281 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {301 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
282- return gobject.SignalConnect(x.GoPointer(), "location-toggle-popup", cbRefPtr)302+ handlerID := gobject.SignalConnect(x.GoPointer(), "location-toggle-popup", cbRefPtr)
303+ glib.SaveHandlerMapping(handlerID, cbPtr)
304+ return handlerID
283 }305 }
284 306
285 fcb := func(clsPtr uintptr) {307 fcb := func(clsPtr uintptr) {
@@ -292,7 +314,9 @@ func (x *FileChooserWidget) ConnectLocationTogglePopup(cb *func(FileChooserWidge
292 }314 }
293 cbRefPtr := purego.NewCallback(fcb)315 cbRefPtr := purego.NewCallback(fcb)
294 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)316 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
295- return gobject.SignalConnect(x.GoPointer(), "location-toggle-popup", cbRefPtr)317+ handlerID := gobject.SignalConnect(x.GoPointer(), "location-toggle-popup", cbRefPtr)
318+ glib.SaveHandlerMapping(handlerID, cbPtr)
319+ return handlerID
296 }320 }
297 321
298 // Emitted when the user asks for it.322 // Emitted when the user asks for it.
@@ -302,10 +326,12 @@ func (x *FileChooserWidget) ConnectLocationTogglePopup(cb *func(FileChooserWidge
302 // This is used to move the focus to the places sidebar.326 // This is used to move the focus to the places sidebar.
303 //327 //
304 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;P&lt;/kbd&gt;.328 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;P&lt;/kbd&gt;.
305-func (x *FileChooserWidget) ConnectPlacesShortcut(cb *func(FileChooserWidget)) uint32 {329+func (x *FileChooserWidget) ConnectPlacesShortcut(cb *func(FileChooserWidget)) uint {
306 cbPtr := uintptr(unsafe.Pointer(cb))330 cbPtr := uintptr(unsafe.Pointer(cb))
307 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {331 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
308- return gobject.SignalConnect(x.GoPointer(), "places-shortcut", cbRefPtr)332+ handlerID := gobject.SignalConnect(x.GoPointer(), "places-shortcut", cbRefPtr)
333+ glib.SaveHandlerMapping(handlerID, cbPtr)
334+ return handlerID
309 }335 }
310 336
311 fcb := func(clsPtr uintptr) {337 fcb := func(clsPtr uintptr) {
@@ -318,7 +344,9 @@ func (x *FileChooserWidget) ConnectPlacesShortcut(cb *func(FileChooserWidget)) u
318 }344 }
319 cbRefPtr := purego.NewCallback(fcb)345 cbRefPtr := purego.NewCallback(fcb)
320 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)346 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
321- return gobject.SignalConnect(x.GoPointer(), "places-shortcut", cbRefPtr)347+ handlerID := gobject.SignalConnect(x.GoPointer(), "places-shortcut", cbRefPtr)
348+ glib.SaveHandlerMapping(handlerID, cbPtr)
349+ return handlerID
322 }350 }
323 351
324 // Emitted when the user asks for it.352 // Emitted when the user asks for it.
@@ -335,10 +363,12 @@ func (x *FileChooserWidget) ConnectPlacesShortcut(cb *func(FileChooserWidget)) u
335 // Note that in the default binding, that &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;1&lt;/kbd&gt; is363 // Note that in the default binding, that &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;1&lt;/kbd&gt; is
336 // actually defined to switch to the bookmark at index 0, and so on364 // actually defined to switch to the bookmark at index 0, and so on
337 // successively.365 // successively.
338-func (x *FileChooserWidget) ConnectQuickBookmark(cb *func(FileChooserWidget, int)) uint32 {366+func (x *FileChooserWidget) ConnectQuickBookmark(cb *func(FileChooserWidget, int)) uint {
339 cbPtr := uintptr(unsafe.Pointer(cb))367 cbPtr := uintptr(unsafe.Pointer(cb))
340 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {368 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
341- return gobject.SignalConnect(x.GoPointer(), "quick-bookmark", cbRefPtr)369+ handlerID := gobject.SignalConnect(x.GoPointer(), "quick-bookmark", cbRefPtr)
370+ glib.SaveHandlerMapping(handlerID, cbPtr)
371+ return handlerID
342 }372 }
343 373
344 fcb := func(clsPtr uintptr, BookmarkIndexVarp int) {374 fcb := func(clsPtr uintptr, BookmarkIndexVarp int) {
@@ -351,7 +381,9 @@ func (x *FileChooserWidget) ConnectQuickBookmark(cb *func(FileChooserWidget, int
351 }381 }
352 cbRefPtr := purego.NewCallback(fcb)382 cbRefPtr := purego.NewCallback(fcb)
353 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)383 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
354- return gobject.SignalConnect(x.GoPointer(), "quick-bookmark", cbRefPtr)384+ handlerID := gobject.SignalConnect(x.GoPointer(), "quick-bookmark", cbRefPtr)
385+ glib.SaveHandlerMapping(handlerID, cbPtr)
386+ return handlerID
355 }387 }
356 388
357 // Emitted when the user asks for it.389 // Emitted when the user asks for it.
@@ -361,10 +393,12 @@ func (x *FileChooserWidget) ConnectQuickBookmark(cb *func(FileChooserWidget, int
361 // This is used to make the file chooser show the Recent location.393 // This is used to make the file chooser show the Recent location.
362 //394 //
363 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;R&lt;/kbd&gt;.395 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;R&lt;/kbd&gt;.
364-func (x *FileChooserWidget) ConnectRecentShortcut(cb *func(FileChooserWidget)) uint32 {396+func (x *FileChooserWidget) ConnectRecentShortcut(cb *func(FileChooserWidget)) uint {
365 cbPtr := uintptr(unsafe.Pointer(cb))397 cbPtr := uintptr(unsafe.Pointer(cb))
366 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {398 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
367- return gobject.SignalConnect(x.GoPointer(), "recent-shortcut", cbRefPtr)399+ handlerID := gobject.SignalConnect(x.GoPointer(), "recent-shortcut", cbRefPtr)
400+ glib.SaveHandlerMapping(handlerID, cbPtr)
401+ return handlerID
368 }402 }
369 403
370 fcb := func(clsPtr uintptr) {404 fcb := func(clsPtr uintptr) {
@@ -377,7 +411,9 @@ func (x *FileChooserWidget) ConnectRecentShortcut(cb *func(FileChooserWidget)) u
377 }411 }
378 cbRefPtr := purego.NewCallback(fcb)412 cbRefPtr := purego.NewCallback(fcb)
379 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)413 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
380- return gobject.SignalConnect(x.GoPointer(), "recent-shortcut", cbRefPtr)414+ handlerID := gobject.SignalConnect(x.GoPointer(), "recent-shortcut", cbRefPtr)
415+ glib.SaveHandlerMapping(handlerID, cbPtr)
416+ return handlerID
381 }417 }
382 418
383 // Emitted when the user asks for it.419 // Emitted when the user asks for it.
@@ -387,10 +423,12 @@ func (x *FileChooserWidget) ConnectRecentShortcut(cb *func(FileChooserWidget)) u
387 // This is used to make the file chooser show the search entry.423 // This is used to make the file chooser show the search entry.
388 //424 //
389 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;S&lt;/kbd&gt;.425 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;S&lt;/kbd&gt;.
390-func (x *FileChooserWidget) ConnectSearchShortcut(cb *func(FileChooserWidget)) uint32 {426+func (x *FileChooserWidget) ConnectSearchShortcut(cb *func(FileChooserWidget)) uint {
391 cbPtr := uintptr(unsafe.Pointer(cb))427 cbPtr := uintptr(unsafe.Pointer(cb))
392 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {428 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
393- return gobject.SignalConnect(x.GoPointer(), "search-shortcut", cbRefPtr)429+ handlerID := gobject.SignalConnect(x.GoPointer(), "search-shortcut", cbRefPtr)
430+ glib.SaveHandlerMapping(handlerID, cbPtr)
431+ return handlerID
394 }432 }
395 433
396 fcb := func(clsPtr uintptr) {434 fcb := func(clsPtr uintptr) {
@@ -403,7 +441,9 @@ func (x *FileChooserWidget) ConnectSearchShortcut(cb *func(FileChooserWidget)) u
403 }441 }
404 cbRefPtr := purego.NewCallback(fcb)442 cbRefPtr := purego.NewCallback(fcb)
405 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)443 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
406- return gobject.SignalConnect(x.GoPointer(), "search-shortcut", cbRefPtr)444+ handlerID := gobject.SignalConnect(x.GoPointer(), "search-shortcut", cbRefPtr)
445+ glib.SaveHandlerMapping(handlerID, cbPtr)
446+ return handlerID
407 }447 }
408 448
409 // Emitted when the user asks for it.449 // Emitted when the user asks for it.
@@ -413,10 +453,12 @@ func (x *FileChooserWidget) ConnectSearchShortcut(cb *func(FileChooserWidget)) u
413 // This is used to make the file chooser display hidden files.453 // This is used to make the file chooser display hidden files.
414 //454 //
415 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;H&lt;/kbd&gt;.455 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;H&lt;/kbd&gt;.
416-func (x *FileChooserWidget) ConnectShowHidden(cb *func(FileChooserWidget)) uint32 {456+func (x *FileChooserWidget) ConnectShowHidden(cb *func(FileChooserWidget)) uint {
417 cbPtr := uintptr(unsafe.Pointer(cb))457 cbPtr := uintptr(unsafe.Pointer(cb))
418 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {458 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
419- return gobject.SignalConnect(x.GoPointer(), "show-hidden", cbRefPtr)459+ handlerID := gobject.SignalConnect(x.GoPointer(), "show-hidden", cbRefPtr)
460+ glib.SaveHandlerMapping(handlerID, cbPtr)
461+ return handlerID
420 }462 }
421 463
422 fcb := func(clsPtr uintptr) {464 fcb := func(clsPtr uintptr) {
@@ -429,7 +471,9 @@ func (x *FileChooserWidget) ConnectShowHidden(cb *func(FileChooserWidget)) uint3
429 }471 }
430 cbRefPtr := purego.NewCallback(fcb)472 cbRefPtr := purego.NewCallback(fcb)
431 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)473 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
432- return gobject.SignalConnect(x.GoPointer(), "show-hidden", cbRefPtr)474+ handlerID := gobject.SignalConnect(x.GoPointer(), "show-hidden", cbRefPtr)
475+ glib.SaveHandlerMapping(handlerID, cbPtr)
476+ return handlerID
433 }477 }
434 478
435 // Emitted when the user asks for it.479 // Emitted when the user asks for it.
@@ -440,10 +484,12 @@ func (x *FileChooserWidget) ConnectShowHidden(cb *func(FileChooserWidget)) uint3
440 // of the current folder in the file hierarchy.484 // of the current folder in the file hierarchy.
441 //485 //
442 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Up&lt;/kbd&gt;.486 // The default binding for this signal is &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Up&lt;/kbd&gt;.
443-func (x *FileChooserWidget) ConnectUpFolder(cb *func(FileChooserWidget)) uint32 {487+func (x *FileChooserWidget) ConnectUpFolder(cb *func(FileChooserWidget)) uint {
444 cbPtr := uintptr(unsafe.Pointer(cb))488 cbPtr := uintptr(unsafe.Pointer(cb))
445 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {489 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
446- return gobject.SignalConnect(x.GoPointer(), "up-folder", cbRefPtr)490+ handlerID := gobject.SignalConnect(x.GoPointer(), "up-folder", cbRefPtr)
491+ glib.SaveHandlerMapping(handlerID, cbPtr)
492+ return handlerID
447 }493 }
448 494
449 fcb := func(clsPtr uintptr) {495 fcb := func(clsPtr uintptr) {
@@ -456,7 +502,9 @@ func (x *FileChooserWidget) ConnectUpFolder(cb *func(FileChooserWidget)) uint32
456 }502 }
457 cbRefPtr := purego.NewCallback(fcb)503 cbRefPtr := purego.NewCallback(fcb)
458 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)504 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
459- return gobject.SignalConnect(x.GoPointer(), "up-folder", cbRefPtr)505+ handlerID := gobject.SignalConnect(x.GoPointer(), "up-folder", cbRefPtr)
506+ glib.SaveHandlerMapping(handlerID, cbPtr)
507+ return handlerID
460 }508 }
461 509
462 // Requests the user's screen reader to announce the given message.510 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkfilter.go +7 -3
@@ -446,10 +446,12 @@ func (c *Filter) SetGoPointer(ptr uintptr) {
446 // Depending on the @change parameter, not all items need446 // Depending on the @change parameter, not all items need
447 // to be checked, but only some. Refer to the [enum@Gtk.FilterChange]447 // to be checked, but only some. Refer to the [enum@Gtk.FilterChange]
448 // documentation for details.448 // documentation for details.
449-func (x *Filter) ConnectChanged(cb *func(Filter, FilterChange)) uint32 {449+func (x *Filter) ConnectChanged(cb *func(Filter, FilterChange)) uint {
450 cbPtr := uintptr(unsafe.Pointer(cb))450 cbPtr := uintptr(unsafe.Pointer(cb))
451 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {451 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
452- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)452+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
453+ glib.SaveHandlerMapping(handlerID, cbPtr)
454+ return handlerID
453 }455 }
454 456
455 fcb := func(clsPtr uintptr, ChangeVarp FilterChange) {457 fcb := func(clsPtr uintptr, ChangeVarp FilterChange) {
@@ -462,7 +464,9 @@ func (x *Filter) ConnectChanged(cb *func(Filter, FilterChange)) uint32 {
462 }464 }
463 cbRefPtr := purego.NewCallback(fcb)465 cbRefPtr := purego.NewCallback(fcb)
464 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)466 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
465- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)467+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
468+ glib.SaveHandlerMapping(handlerID, cbPtr)
469+ return handlerID
466 }470 }
467 471
468 func init() {472 func init() {
M v4/gtk/gtkflowbox.go +56 -24
@@ -849,10 +849,12 @@ func (x *FlowBox) GetPropertyRowSpacing() uint {
849 // Emitted when the user activates the @box.849 // Emitted when the user activates the @box.
850 //850 //
851 // This is a [keybinding signal](class.SignalAction.html).851 // This is a [keybinding signal](class.SignalAction.html).
852-func (x *FlowBox) ConnectActivateCursorChild(cb *func(FlowBox)) uint32 {852+func (x *FlowBox) ConnectActivateCursorChild(cb *func(FlowBox)) uint {
853 cbPtr := uintptr(unsafe.Pointer(cb))853 cbPtr := uintptr(unsafe.Pointer(cb))
854 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {854 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
855- return gobject.SignalConnect(x.GoPointer(), "activate-cursor-child", cbRefPtr)855+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-child", cbRefPtr)
856+ glib.SaveHandlerMapping(handlerID, cbPtr)
857+ return handlerID
856 }858 }
857 859
858 fcb := func(clsPtr uintptr) {860 fcb := func(clsPtr uintptr) {
@@ -865,14 +867,18 @@ func (x *FlowBox) ConnectActivateCursorChild(cb *func(FlowBox)) uint32 {
865 }867 }
866 cbRefPtr := purego.NewCallback(fcb)868 cbRefPtr := purego.NewCallback(fcb)
867 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)869 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
868- return gobject.SignalConnect(x.GoPointer(), "activate-cursor-child", cbRefPtr)870+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-child", cbRefPtr)
871+ glib.SaveHandlerMapping(handlerID, cbPtr)
872+ return handlerID
869 }873 }
870 874
871 // Emitted when a child has been activated by the user.875 // Emitted when a child has been activated by the user.
872-func (x *FlowBox) ConnectChildActivated(cb *func(FlowBox, uintptr)) uint32 {876+func (x *FlowBox) ConnectChildActivated(cb *func(FlowBox, uintptr)) uint {
873 cbPtr := uintptr(unsafe.Pointer(cb))877 cbPtr := uintptr(unsafe.Pointer(cb))
874 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {878 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
875- return gobject.SignalConnect(x.GoPointer(), "child-activated", cbRefPtr)879+ handlerID := gobject.SignalConnect(x.GoPointer(), "child-activated", cbRefPtr)
880+ glib.SaveHandlerMapping(handlerID, cbPtr)
881+ return handlerID
876 }882 }
877 883
878 fcb := func(clsPtr uintptr, ChildVarp uintptr) {884 fcb := func(clsPtr uintptr, ChildVarp uintptr) {
@@ -885,7 +891,9 @@ func (x *FlowBox) ConnectChildActivated(cb *func(FlowBox, uintptr)) uint32 {
885 }891 }
886 cbRefPtr := purego.NewCallback(fcb)892 cbRefPtr := purego.NewCallback(fcb)
887 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)893 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
888- return gobject.SignalConnect(x.GoPointer(), "child-activated", cbRefPtr)894+ handlerID := gobject.SignalConnect(x.GoPointer(), "child-activated", cbRefPtr)
895+ glib.SaveHandlerMapping(handlerID, cbPtr)
896+ return handlerID
889 }897 }
890 898
891 // Emitted when the user initiates a cursor movement.899 // Emitted when the user initiates a cursor movement.
@@ -904,10 +912,12 @@ func (x *FlowBox) ConnectChildActivated(cb *func(FlowBox, uintptr)) uint32 {
904 // move by individual children912 // move by individual children
905 // - &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the box913 // - &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the box
906 // - &lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt; move vertically by pages914 // - &lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt; move vertically by pages
907-func (x *FlowBox) ConnectMoveCursor(cb *func(FlowBox, MovementStep, int, bool, bool) bool) uint32 {915+func (x *FlowBox) ConnectMoveCursor(cb *func(FlowBox, MovementStep, int, bool, bool) bool) uint {
908 cbPtr := uintptr(unsafe.Pointer(cb))916 cbPtr := uintptr(unsafe.Pointer(cb))
909 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {917 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
910- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)918+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
919+ glib.SaveHandlerMapping(handlerID, cbPtr)
920+ return handlerID
911 }921 }
912 922
913 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) bool {923 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) bool {
@@ -920,7 +930,9 @@ func (x *FlowBox) ConnectMoveCursor(cb *func(FlowBox, MovementStep, int, bool, b
920 }930 }
921 cbRefPtr := purego.NewCallback(fcb)931 cbRefPtr := purego.NewCallback(fcb)
922 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)932 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
923- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)933+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
934+ glib.SaveHandlerMapping(handlerID, cbPtr)
935+ return handlerID
924 }936 }
925 937
926 // Emitted to select all children of the box,938 // Emitted to select all children of the box,
@@ -929,10 +941,12 @@ func (x *FlowBox) ConnectMoveCursor(cb *func(FlowBox, MovementStep, int, bool, b
929 // This is a [keybinding signal](class.SignalAction.html).941 // This is a [keybinding signal](class.SignalAction.html).
930 //942 //
931 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.943 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.
932-func (x *FlowBox) ConnectSelectAll(cb *func(FlowBox)) uint32 {944+func (x *FlowBox) ConnectSelectAll(cb *func(FlowBox)) uint {
933 cbPtr := uintptr(unsafe.Pointer(cb))945 cbPtr := uintptr(unsafe.Pointer(cb))
934 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {946 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
935- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)947+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
948+ glib.SaveHandlerMapping(handlerID, cbPtr)
949+ return handlerID
936 }950 }
937 951
938 fcb := func(clsPtr uintptr) {952 fcb := func(clsPtr uintptr) {
@@ -945,7 +959,9 @@ func (x *FlowBox) ConnectSelectAll(cb *func(FlowBox)) uint32 {
945 }959 }
946 cbRefPtr := purego.NewCallback(fcb)960 cbRefPtr := purego.NewCallback(fcb)
947 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)961 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
948- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)962+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
963+ glib.SaveHandlerMapping(handlerID, cbPtr)
964+ return handlerID
949 }965 }
950 966
951 // Emitted when the set of selected children changes.967 // Emitted when the set of selected children changes.
@@ -953,10 +969,12 @@ func (x *FlowBox) ConnectSelectAll(cb *func(FlowBox)) uint32 {
953 // Use [method@Gtk.FlowBox.selected_foreach] or969 // Use [method@Gtk.FlowBox.selected_foreach] or
954 // [method@Gtk.FlowBox.get_selected_children] to obtain the970 // [method@Gtk.FlowBox.get_selected_children] to obtain the
955 // selected children.971 // selected children.
956-func (x *FlowBox) ConnectSelectedChildrenChanged(cb *func(FlowBox)) uint32 {972+func (x *FlowBox) ConnectSelectedChildrenChanged(cb *func(FlowBox)) uint {
957 cbPtr := uintptr(unsafe.Pointer(cb))973 cbPtr := uintptr(unsafe.Pointer(cb))
958 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {974 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
959- return gobject.SignalConnect(x.GoPointer(), "selected-children-changed", cbRefPtr)975+ handlerID := gobject.SignalConnect(x.GoPointer(), "selected-children-changed", cbRefPtr)
976+ glib.SaveHandlerMapping(handlerID, cbPtr)
977+ return handlerID
960 }978 }
961 979
962 fcb := func(clsPtr uintptr) {980 fcb := func(clsPtr uintptr) {
@@ -969,7 +987,9 @@ func (x *FlowBox) ConnectSelectedChildrenChanged(cb *func(FlowBox)) uint32 {
969 }987 }
970 cbRefPtr := purego.NewCallback(fcb)988 cbRefPtr := purego.NewCallback(fcb)
971 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)989 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
972- return gobject.SignalConnect(x.GoPointer(), "selected-children-changed", cbRefPtr)990+ handlerID := gobject.SignalConnect(x.GoPointer(), "selected-children-changed", cbRefPtr)
991+ glib.SaveHandlerMapping(handlerID, cbPtr)
992+ return handlerID
973 }993 }
974 994
975 // Emitted to toggle the selection of the child that has the focus.995 // Emitted to toggle the selection of the child that has the focus.
@@ -977,10 +997,12 @@ func (x *FlowBox) ConnectSelectedChildrenChanged(cb *func(FlowBox)) uint32 {
977 // This is a [keybinding signal](class.SignalAction.html).997 // This is a [keybinding signal](class.SignalAction.html).
978 //998 //
979 // The default binding for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;Space&lt;/kbd&gt;.999 // The default binding for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;Space&lt;/kbd&gt;.
980-func (x *FlowBox) ConnectToggleCursorChild(cb *func(FlowBox)) uint32 {1000+func (x *FlowBox) ConnectToggleCursorChild(cb *func(FlowBox)) uint {
981 cbPtr := uintptr(unsafe.Pointer(cb))1001 cbPtr := uintptr(unsafe.Pointer(cb))
982 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1002 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
983- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-child", cbRefPtr)1003+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-child", cbRefPtr)
1004+ glib.SaveHandlerMapping(handlerID, cbPtr)
1005+ return handlerID
984 }1006 }
985 1007
986 fcb := func(clsPtr uintptr) {1008 fcb := func(clsPtr uintptr) {
@@ -993,7 +1015,9 @@ func (x *FlowBox) ConnectToggleCursorChild(cb *func(FlowBox)) uint32 {
993 }1015 }
994 cbRefPtr := purego.NewCallback(fcb)1016 cbRefPtr := purego.NewCallback(fcb)
995 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1017 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
996- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-child", cbRefPtr)1018+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-child", cbRefPtr)
1019+ glib.SaveHandlerMapping(handlerID, cbPtr)
1020+ return handlerID
997 }1021 }
998 1022
999 // Emitted to unselect all children of the box,1023 // Emitted to unselect all children of the box,
@@ -1002,10 +1026,12 @@ func (x *FlowBox) ConnectToggleCursorChild(cb *func(FlowBox)) uint32 {
1002 // This is a [keybinding signal](class.SignalAction.html).1026 // This is a [keybinding signal](class.SignalAction.html).
1003 //1027 //
1004 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;Shift&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.1028 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;Shift&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.
1005-func (x *FlowBox) ConnectUnselectAll(cb *func(FlowBox)) uint32 {1029+func (x *FlowBox) ConnectUnselectAll(cb *func(FlowBox)) uint {
1006 cbPtr := uintptr(unsafe.Pointer(cb))1030 cbPtr := uintptr(unsafe.Pointer(cb))
1007 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1031 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1008- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)1032+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1033+ glib.SaveHandlerMapping(handlerID, cbPtr)
1034+ return handlerID
1009 }1035 }
1010 1036
1011 fcb := func(clsPtr uintptr) {1037 fcb := func(clsPtr uintptr) {
@@ -1018,7 +1044,9 @@ func (x *FlowBox) ConnectUnselectAll(cb *func(FlowBox)) uint32 {
1018 }1044 }
1019 cbRefPtr := purego.NewCallback(fcb)1045 cbRefPtr := purego.NewCallback(fcb)
1020 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1046 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1021- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)1047+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1048+ glib.SaveHandlerMapping(handlerID, cbPtr)
1049+ return handlerID
1022 }1050 }
1023 1051
1024 // Requests the user's screen reader to announce the given message.1052 // Requests the user's screen reader to announce the given message.
@@ -1451,10 +1479,12 @@ func (c *FlowBoxChild) SetGoPointer(ptr uintptr) {
1451 // but it can be used by applications for their own purposes.1479 // but it can be used by applications for their own purposes.
1452 //1480 //
1453 // The default bindings are &lt;kbd&gt;Space&lt;/kbd&gt; and &lt;kbd&gt;Enter&lt;/kbd&gt;.1481 // The default bindings are &lt;kbd&gt;Space&lt;/kbd&gt; and &lt;kbd&gt;Enter&lt;/kbd&gt;.
1454-func (x *FlowBoxChild) ConnectActivate(cb *func(FlowBoxChild)) uint32 {1482+func (x *FlowBoxChild) ConnectActivate(cb *func(FlowBoxChild)) uint {
1455 cbPtr := uintptr(unsafe.Pointer(cb))1483 cbPtr := uintptr(unsafe.Pointer(cb))
1456 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1484 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1457- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1485+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1486+ glib.SaveHandlerMapping(handlerID, cbPtr)
1487+ return handlerID
1458 }1488 }
1459 1489
1460 fcb := func(clsPtr uintptr) {1490 fcb := func(clsPtr uintptr) {
@@ -1467,7 +1497,9 @@ func (x *FlowBoxChild) ConnectActivate(cb *func(FlowBoxChild)) uint32 {
1467 }1497 }
1468 cbRefPtr := purego.NewCallback(fcb)1498 cbRefPtr := purego.NewCallback(fcb)
1469 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1499 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1470- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1500+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1501+ glib.SaveHandlerMapping(handlerID, cbPtr)
1502+ return handlerID
1471 }1503 }
1472 1504
1473 // Requests the user's screen reader to announce the given message.1505 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkfontbutton.go +14 -6
@@ -247,10 +247,12 @@ func (x *FontButton) GetPropertyUseSize() bool {
247 //247 //
248 // The `::activate` signal on `GtkFontButton` is an action signal and248 // The `::activate` signal on `GtkFontButton` is an action signal and
249 // emitting it causes the button to present its dialog.249 // emitting it causes the button to present its dialog.
250-func (x *FontButton) ConnectActivate(cb *func(FontButton)) uint32 {250+func (x *FontButton) ConnectActivate(cb *func(FontButton)) uint {
251 cbPtr := uintptr(unsafe.Pointer(cb))251 cbPtr := uintptr(unsafe.Pointer(cb))
252 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {252 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
253- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)253+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
254+ glib.SaveHandlerMapping(handlerID, cbPtr)
255+ return handlerID
254 }256 }
255 257
256 fcb := func(clsPtr uintptr) {258 fcb := func(clsPtr uintptr) {
@@ -263,7 +265,9 @@ func (x *FontButton) ConnectActivate(cb *func(FontButton)) uint32 {
263 }265 }
264 cbRefPtr := purego.NewCallback(fcb)266 cbRefPtr := purego.NewCallback(fcb)
265 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)267 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
266- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)268+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
269+ glib.SaveHandlerMapping(handlerID, cbPtr)
270+ return handlerID
267 }271 }
268 272
269 // Emitted when the user selects a font.273 // Emitted when the user selects a font.
@@ -274,10 +278,12 @@ func (x *FontButton) ConnectActivate(cb *func(FontButton)) uint32 {
274 // Note that this signal is only emitted when the user changes the font.278 // Note that this signal is only emitted when the user changes the font.
275 // If you need to react to programmatic font changes as well, use279 // If you need to react to programmatic font changes as well, use
276 // the notify::font signal.280 // the notify::font signal.
277-func (x *FontButton) ConnectFontSet(cb *func(FontButton)) uint32 {281+func (x *FontButton) ConnectFontSet(cb *func(FontButton)) uint {
278 cbPtr := uintptr(unsafe.Pointer(cb))282 cbPtr := uintptr(unsafe.Pointer(cb))
279 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {283 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
280- return gobject.SignalConnect(x.GoPointer(), "font-set", cbRefPtr)284+ handlerID := gobject.SignalConnect(x.GoPointer(), "font-set", cbRefPtr)
285+ glib.SaveHandlerMapping(handlerID, cbPtr)
286+ return handlerID
281 }287 }
282 288
283 fcb := func(clsPtr uintptr) {289 fcb := func(clsPtr uintptr) {
@@ -290,7 +296,9 @@ func (x *FontButton) ConnectFontSet(cb *func(FontButton)) uint32 {
290 }296 }
291 cbRefPtr := purego.NewCallback(fcb)297 cbRefPtr := purego.NewCallback(fcb)
292 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)298 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
293- return gobject.SignalConnect(x.GoPointer(), "font-set", cbRefPtr)299+ handlerID := gobject.SignalConnect(x.GoPointer(), "font-set", cbRefPtr)
300+ glib.SaveHandlerMapping(handlerID, cbPtr)
301+ return handlerID
294 }302 }
295 303
296 // Requests the user's screen reader to announce the given message.304 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkfontdialogbutton.go +7 -3
@@ -409,10 +409,12 @@ func (x *FontDialogButton) GetPropertyUseSize() bool {
409 //409 //
410 // The `::activate` signal on `GtkFontDialogButton` is an action signal410 // The `::activate` signal on `GtkFontDialogButton` is an action signal
411 // and emitting it causes the button to pop up its dialog.411 // and emitting it causes the button to pop up its dialog.
412-func (x *FontDialogButton) ConnectActivate(cb *func(FontDialogButton)) uint32 {412+func (x *FontDialogButton) ConnectActivate(cb *func(FontDialogButton)) uint {
413 cbPtr := uintptr(unsafe.Pointer(cb))413 cbPtr := uintptr(unsafe.Pointer(cb))
414 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {414 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
415- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)415+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
416+ glib.SaveHandlerMapping(handlerID, cbPtr)
417+ return handlerID
416 }418 }
417 419
418 fcb := func(clsPtr uintptr) {420 fcb := func(clsPtr uintptr) {
@@ -425,7 +427,9 @@ func (x *FontDialogButton) ConnectActivate(cb *func(FontDialogButton)) uint32 {
425 }427 }
426 cbRefPtr := purego.NewCallback(fcb)428 cbRefPtr := purego.NewCallback(fcb)
427 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)429 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
428- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)430+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
431+ glib.SaveHandlerMapping(handlerID, cbPtr)
432+ return handlerID
429 }433 }
430 434
431 // Requests the user's screen reader to announce the given message.435 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkgesture.go +35 -15
@@ -489,10 +489,12 @@ func (x *Gesture) GetPropertyNPoints() uint {
489 // (eg. a third touch on a 2-touches gesture) is lifted, in that489 // (eg. a third touch on a 2-touches gesture) is lifted, in that
490 // situation @sequence won't pertain to the current set of active490 // situation @sequence won't pertain to the current set of active
491 // touches, so don't rely on this being true.491 // touches, so don't rely on this being true.
492-func (x *Gesture) ConnectBegin(cb *func(Gesture, uintptr)) uint32 {492+func (x *Gesture) ConnectBegin(cb *func(Gesture, uintptr)) uint {
493 cbPtr := uintptr(unsafe.Pointer(cb))493 cbPtr := uintptr(unsafe.Pointer(cb))
494 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {494 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
495- return gobject.SignalConnect(x.GoPointer(), "begin", cbRefPtr)495+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin", cbRefPtr)
496+ glib.SaveHandlerMapping(handlerID, cbPtr)
497+ return handlerID
496 }498 }
497 499
498 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {500 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {
@@ -505,7 +507,9 @@ func (x *Gesture) ConnectBegin(cb *func(Gesture, uintptr)) uint32 {
505 }507 }
506 cbRefPtr := purego.NewCallback(fcb)508 cbRefPtr := purego.NewCallback(fcb)
507 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)509 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
508- return gobject.SignalConnect(x.GoPointer(), "begin", cbRefPtr)510+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin", cbRefPtr)
511+ glib.SaveHandlerMapping(handlerID, cbPtr)
512+ return handlerID
509 }513 }
510 514
511 // Emitted whenever a sequence is cancelled.515 // Emitted whenever a sequence is cancelled.
@@ -518,10 +522,12 @@ func (x *Gesture) ConnectBegin(cb *func(Gesture, uintptr)) uint32 {
518 //522 //
519 // @gesture must forget everything about @sequence as in523 // @gesture must forget everything about @sequence as in
520 // response to this signal.524 // response to this signal.
521-func (x *Gesture) ConnectCancel(cb *func(Gesture, uintptr)) uint32 {525+func (x *Gesture) ConnectCancel(cb *func(Gesture, uintptr)) uint {
522 cbPtr := uintptr(unsafe.Pointer(cb))526 cbPtr := uintptr(unsafe.Pointer(cb))
523 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {527 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
524- return gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)528+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
529+ glib.SaveHandlerMapping(handlerID, cbPtr)
530+ return handlerID
525 }531 }
526 532
527 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {533 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {
@@ -534,7 +540,9 @@ func (x *Gesture) ConnectCancel(cb *func(Gesture, uintptr)) uint32 {
534 }540 }
535 cbRefPtr := purego.NewCallback(fcb)541 cbRefPtr := purego.NewCallback(fcb)
536 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)542 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
537- return gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)543+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel", cbRefPtr)
544+ glib.SaveHandlerMapping(handlerID, cbPtr)
545+ return handlerID
538 }546 }
539 547
540 // Emitted when @gesture either stopped recognizing the event548 // Emitted when @gesture either stopped recognizing the event
@@ -546,10 +554,12 @@ func (x *Gesture) ConnectCancel(cb *func(Gesture, uintptr)) uint32 {
546 // pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]).554 // pressed touch sequence that exceeds [property@Gtk.Gesture:n-points]).
547 // This situation may be detected by checking through555 // This situation may be detected by checking through
548 // [method@Gtk.Gesture.handles_sequence].556 // [method@Gtk.Gesture.handles_sequence].
549-func (x *Gesture) ConnectEnd(cb *func(Gesture, uintptr)) uint32 {557+func (x *Gesture) ConnectEnd(cb *func(Gesture, uintptr)) uint {
550 cbPtr := uintptr(unsafe.Pointer(cb))558 cbPtr := uintptr(unsafe.Pointer(cb))
551 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {559 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
552- return gobject.SignalConnect(x.GoPointer(), "end", cbRefPtr)560+ handlerID := gobject.SignalConnect(x.GoPointer(), "end", cbRefPtr)
561+ glib.SaveHandlerMapping(handlerID, cbPtr)
562+ return handlerID
553 }563 }
554 564
555 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {565 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {
@@ -562,17 +572,21 @@ func (x *Gesture) ConnectEnd(cb *func(Gesture, uintptr)) uint32 {
562 }572 }
563 cbRefPtr := purego.NewCallback(fcb)573 cbRefPtr := purego.NewCallback(fcb)
564 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)574 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
565- return gobject.SignalConnect(x.GoPointer(), "end", cbRefPtr)575+ handlerID := gobject.SignalConnect(x.GoPointer(), "end", cbRefPtr)
576+ glib.SaveHandlerMapping(handlerID, cbPtr)
577+ return handlerID
566 }578 }
567 579
568 // Emitted whenever a sequence state changes.580 // Emitted whenever a sequence state changes.
569 //581 //
570 // See [method@Gtk.Gesture.set_sequence_state] to know582 // See [method@Gtk.Gesture.set_sequence_state] to know
571 // more about the expectable sequence lifetimes.583 // more about the expectable sequence lifetimes.
572-func (x *Gesture) ConnectSequenceStateChanged(cb *func(Gesture, uintptr, EventSequenceState)) uint32 {584+func (x *Gesture) ConnectSequenceStateChanged(cb *func(Gesture, uintptr, EventSequenceState)) uint {
573 cbPtr := uintptr(unsafe.Pointer(cb))585 cbPtr := uintptr(unsafe.Pointer(cb))
574 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {586 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
575- return gobject.SignalConnect(x.GoPointer(), "sequence-state-changed", cbRefPtr)587+ handlerID := gobject.SignalConnect(x.GoPointer(), "sequence-state-changed", cbRefPtr)
588+ glib.SaveHandlerMapping(handlerID, cbPtr)
589+ return handlerID
576 }590 }
577 591
578 fcb := func(clsPtr uintptr, SequenceVarp uintptr, StateVarp EventSequenceState) {592 fcb := func(clsPtr uintptr, SequenceVarp uintptr, StateVarp EventSequenceState) {
@@ -585,16 +599,20 @@ func (x *Gesture) ConnectSequenceStateChanged(cb *func(Gesture, uintptr, EventSe
585 }599 }
586 cbRefPtr := purego.NewCallback(fcb)600 cbRefPtr := purego.NewCallback(fcb)
587 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)601 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
588- return gobject.SignalConnect(x.GoPointer(), "sequence-state-changed", cbRefPtr)602+ handlerID := gobject.SignalConnect(x.GoPointer(), "sequence-state-changed", cbRefPtr)
603+ glib.SaveHandlerMapping(handlerID, cbPtr)
604+ return handlerID
589 }605 }
590 606
591 // Emitted whenever an event is handled while the gesture is recognized.607 // Emitted whenever an event is handled while the gesture is recognized.
592 //608 //
593 // @sequence is guaranteed to pertain to the set of active touches.609 // @sequence is guaranteed to pertain to the set of active touches.
594-func (x *Gesture) ConnectUpdate(cb *func(Gesture, uintptr)) uint32 {610+func (x *Gesture) ConnectUpdate(cb *func(Gesture, uintptr)) uint {
595 cbPtr := uintptr(unsafe.Pointer(cb))611 cbPtr := uintptr(unsafe.Pointer(cb))
596 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {612 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
597- return gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)613+ handlerID := gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)
614+ glib.SaveHandlerMapping(handlerID, cbPtr)
615+ return handlerID
598 }616 }
599 617
600 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {618 fcb := func(clsPtr uintptr, SequenceVarp uintptr) {
@@ -607,7 +625,9 @@ func (x *Gesture) ConnectUpdate(cb *func(Gesture, uintptr)) uint32 {
607 }625 }
608 cbRefPtr := purego.NewCallback(fcb)626 cbRefPtr := purego.NewCallback(fcb)
609 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)627 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
610- return gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)628+ handlerID := gobject.SignalConnect(x.GoPointer(), "update", cbRefPtr)
629+ glib.SaveHandlerMapping(handlerID, cbPtr)
630+ return handlerID
611 }631 }
612 632
613 func init() {633 func init() {
M v4/gtk/gtkgestureclick.go +28 -12
@@ -72,10 +72,12 @@ func (c *GestureClick) SetGoPointer(ptr uintptr) {
72 }72 }
73 73
74 // Emitted whenever a button or touch press happens.74 // Emitted whenever a button or touch press happens.
75-func (x *GestureClick) ConnectPressed(cb *func(GestureClick, int, float64, float64)) uint32 {75+func (x *GestureClick) ConnectPressed(cb *func(GestureClick, int, float64, float64)) uint {
76 cbPtr := uintptr(unsafe.Pointer(cb))76 cbPtr := uintptr(unsafe.Pointer(cb))
77 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {77 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
78- return gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)78+ handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
79+ glib.SaveHandlerMapping(handlerID, cbPtr)
80+ return handlerID
79 }81 }
80 82
81 fcb := func(clsPtr uintptr, NPressVarp int, XVarp float64, YVarp float64) {83 fcb := func(clsPtr uintptr, NPressVarp int, XVarp float64, YVarp float64) {
@@ -88,7 +90,9 @@ func (x *GestureClick) ConnectPressed(cb *func(GestureClick, int, float64, float
88 }90 }
89 cbRefPtr := purego.NewCallback(fcb)91 cbRefPtr := purego.NewCallback(fcb)
90 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)92 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
91- return gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)93+ handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
94+ glib.SaveHandlerMapping(handlerID, cbPtr)
95+ return handlerID
92 }96 }
93 97
94 // Emitted when a button or touch is released.98 // Emitted when a button or touch is released.
@@ -97,10 +101,12 @@ func (x *GestureClick) ConnectPressed(cb *func(GestureClick, int, float64, float
97 // this event, note that [signal@Gtk.GestureClick::stopped] may101 // this event, note that [signal@Gtk.GestureClick::stopped] may
98 // have been emitted between the press and its release, @n_press102 // have been emitted between the press and its release, @n_press
99 // will only start over at the next press.103 // will only start over at the next press.
100-func (x *GestureClick) ConnectReleased(cb *func(GestureClick, int, float64, float64)) uint32 {104+func (x *GestureClick) ConnectReleased(cb *func(GestureClick, int, float64, float64)) uint {
101 cbPtr := uintptr(unsafe.Pointer(cb))105 cbPtr := uintptr(unsafe.Pointer(cb))
102 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {106 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
103- return gobject.SignalConnect(x.GoPointer(), "released", cbRefPtr)107+ handlerID := gobject.SignalConnect(x.GoPointer(), "released", cbRefPtr)
108+ glib.SaveHandlerMapping(handlerID, cbPtr)
109+ return handlerID
104 }110 }
105 111
106 fcb := func(clsPtr uintptr, NPressVarp int, XVarp float64, YVarp float64) {112 fcb := func(clsPtr uintptr, NPressVarp int, XVarp float64, YVarp float64) {
@@ -113,14 +119,18 @@ func (x *GestureClick) ConnectReleased(cb *func(GestureClick, int, float64, floa
113 }119 }
114 cbRefPtr := purego.NewCallback(fcb)120 cbRefPtr := purego.NewCallback(fcb)
115 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)121 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
116- return gobject.SignalConnect(x.GoPointer(), "released", cbRefPtr)122+ handlerID := gobject.SignalConnect(x.GoPointer(), "released", cbRefPtr)
123+ glib.SaveHandlerMapping(handlerID, cbPtr)
124+ return handlerID
117 }125 }
118 126
119 // Emitted whenever any time/distance threshold has been exceeded.127 // Emitted whenever any time/distance threshold has been exceeded.
120-func (x *GestureClick) ConnectStopped(cb *func(GestureClick)) uint32 {128+func (x *GestureClick) ConnectStopped(cb *func(GestureClick)) uint {
121 cbPtr := uintptr(unsafe.Pointer(cb))129 cbPtr := uintptr(unsafe.Pointer(cb))
122 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {130 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
123- return gobject.SignalConnect(x.GoPointer(), "stopped", cbRefPtr)131+ handlerID := gobject.SignalConnect(x.GoPointer(), "stopped", cbRefPtr)
132+ glib.SaveHandlerMapping(handlerID, cbPtr)
133+ return handlerID
124 }134 }
125 135
126 fcb := func(clsPtr uintptr) {136 fcb := func(clsPtr uintptr) {
@@ -133,7 +143,9 @@ func (x *GestureClick) ConnectStopped(cb *func(GestureClick)) uint32 {
133 }143 }
134 cbRefPtr := purego.NewCallback(fcb)144 cbRefPtr := purego.NewCallback(fcb)
135 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)145 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
136- return gobject.SignalConnect(x.GoPointer(), "stopped", cbRefPtr)146+ handlerID := gobject.SignalConnect(x.GoPointer(), "stopped", cbRefPtr)
147+ glib.SaveHandlerMapping(handlerID, cbPtr)
148+ return handlerID
137 }149 }
138 150
139 // Emitted whenever the gesture receives a release151 // Emitted whenever the gesture receives a release
@@ -142,10 +154,12 @@ func (x *GestureClick) ConnectStopped(cb *func(GestureClick)) uint32 {
142 // Due to implicit grabs, this can only happen on situations154 // Due to implicit grabs, this can only happen on situations
143 // where input is grabbed elsewhere mid-press or the pressed155 // where input is grabbed elsewhere mid-press or the pressed
144 // widget voluntarily relinquishes its implicit grab.156 // widget voluntarily relinquishes its implicit grab.
145-func (x *GestureClick) ConnectUnpairedRelease(cb *func(GestureClick, float64, float64, uint, uintptr)) uint32 {157+func (x *GestureClick) ConnectUnpairedRelease(cb *func(GestureClick, float64, float64, uint, uintptr)) uint {
146 cbPtr := uintptr(unsafe.Pointer(cb))158 cbPtr := uintptr(unsafe.Pointer(cb))
147 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {159 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
148- return gobject.SignalConnect(x.GoPointer(), "unpaired-release", cbRefPtr)160+ handlerID := gobject.SignalConnect(x.GoPointer(), "unpaired-release", cbRefPtr)
161+ glib.SaveHandlerMapping(handlerID, cbPtr)
162+ return handlerID
149 }163 }
150 164
151 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64, ButtonVarp uint, SequenceVarp uintptr) {165 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64, ButtonVarp uint, SequenceVarp uintptr) {
@@ -158,7 +172,9 @@ func (x *GestureClick) ConnectUnpairedRelease(cb *func(GestureClick, float64, fl
158 }172 }
159 cbRefPtr := purego.NewCallback(fcb)173 cbRefPtr := purego.NewCallback(fcb)
160 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)174 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
161- return gobject.SignalConnect(x.GoPointer(), "unpaired-release", cbRefPtr)175+ handlerID := gobject.SignalConnect(x.GoPointer(), "unpaired-release", cbRefPtr)
176+ glib.SaveHandlerMapping(handlerID, cbPtr)
177+ return handlerID
162 }178 }
163 179
164 func init() {180 func init() {
M v4/gtk/gtkgesturedrag.go +21 -9
@@ -101,10 +101,12 @@ func (c *GestureDrag) SetGoPointer(ptr uintptr) {
101 }101 }
102 102
103 // Emitted whenever dragging starts.103 // Emitted whenever dragging starts.
104-func (x *GestureDrag) ConnectDragBegin(cb *func(GestureDrag, float64, float64)) uint32 {104+func (x *GestureDrag) ConnectDragBegin(cb *func(GestureDrag, float64, float64)) uint {
105 cbPtr := uintptr(unsafe.Pointer(cb))105 cbPtr := uintptr(unsafe.Pointer(cb))
106 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {106 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
107- return gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)107+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)
108+ glib.SaveHandlerMapping(handlerID, cbPtr)
109+ return handlerID
108 }110 }
109 111
110 fcb := func(clsPtr uintptr, StartXVarp float64, StartYVarp float64) {112 fcb := func(clsPtr uintptr, StartXVarp float64, StartYVarp float64) {
@@ -117,14 +119,18 @@ func (x *GestureDrag) ConnectDragBegin(cb *func(GestureDrag, float64, float64))
117 }119 }
118 cbRefPtr := purego.NewCallback(fcb)120 cbRefPtr := purego.NewCallback(fcb)
119 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)121 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
120- return gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)122+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-begin", cbRefPtr)
123+ glib.SaveHandlerMapping(handlerID, cbPtr)
124+ return handlerID
121 }125 }
122 126
123 // Emitted whenever the dragging is finished.127 // Emitted whenever the dragging is finished.
124-func (x *GestureDrag) ConnectDragEnd(cb *func(GestureDrag, float64, float64)) uint32 {128+func (x *GestureDrag) ConnectDragEnd(cb *func(GestureDrag, float64, float64)) uint {
125 cbPtr := uintptr(unsafe.Pointer(cb))129 cbPtr := uintptr(unsafe.Pointer(cb))
126 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {130 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
127- return gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)131+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)
132+ glib.SaveHandlerMapping(handlerID, cbPtr)
133+ return handlerID
128 }134 }
129 135
130 fcb := func(clsPtr uintptr, OffsetXVarp float64, OffsetYVarp float64) {136 fcb := func(clsPtr uintptr, OffsetXVarp float64, OffsetYVarp float64) {
@@ -137,14 +143,18 @@ func (x *GestureDrag) ConnectDragEnd(cb *func(GestureDrag, float64, float64)) ui
137 }143 }
138 cbRefPtr := purego.NewCallback(fcb)144 cbRefPtr := purego.NewCallback(fcb)
139 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)145 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
140- return gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)146+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-end", cbRefPtr)
147+ glib.SaveHandlerMapping(handlerID, cbPtr)
148+ return handlerID
141 }149 }
142 150
143 // Emitted whenever the dragging point moves.151 // Emitted whenever the dragging point moves.
144-func (x *GestureDrag) ConnectDragUpdate(cb *func(GestureDrag, float64, float64)) uint32 {152+func (x *GestureDrag) ConnectDragUpdate(cb *func(GestureDrag, float64, float64)) uint {
145 cbPtr := uintptr(unsafe.Pointer(cb))153 cbPtr := uintptr(unsafe.Pointer(cb))
146 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {154 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
147- return gobject.SignalConnect(x.GoPointer(), "drag-update", cbRefPtr)155+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-update", cbRefPtr)
156+ glib.SaveHandlerMapping(handlerID, cbPtr)
157+ return handlerID
148 }158 }
149 159
150 fcb := func(clsPtr uintptr, OffsetXVarp float64, OffsetYVarp float64) {160 fcb := func(clsPtr uintptr, OffsetXVarp float64, OffsetYVarp float64) {
@@ -157,7 +167,9 @@ func (x *GestureDrag) ConnectDragUpdate(cb *func(GestureDrag, float64, float64))
157 }167 }
158 cbRefPtr := purego.NewCallback(fcb)168 cbRefPtr := purego.NewCallback(fcb)
159 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)169 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
160- return gobject.SignalConnect(x.GoPointer(), "drag-update", cbRefPtr)170+ handlerID := gobject.SignalConnect(x.GoPointer(), "drag-update", cbRefPtr)
171+ glib.SaveHandlerMapping(handlerID, cbPtr)
172+ return handlerID
161 }173 }
162 174
163 func init() {175 func init() {
M v4/gtk/gtkgesturelongpress.go +14 -6
@@ -119,10 +119,12 @@ func (x *GestureLongPress) GetPropertyDelayFactor() float64 {
119 119
120 // Emitted whenever a press moved too far, or was released120 // Emitted whenever a press moved too far, or was released
121 // before [signal@Gtk.GestureLongPress::pressed] happened.121 // before [signal@Gtk.GestureLongPress::pressed] happened.
122-func (x *GestureLongPress) ConnectCancelled(cb *func(GestureLongPress)) uint32 {122+func (x *GestureLongPress) ConnectCancelled(cb *func(GestureLongPress)) uint {
123 cbPtr := uintptr(unsafe.Pointer(cb))123 cbPtr := uintptr(unsafe.Pointer(cb))
124 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {124 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
125- return gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)125+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)
126+ glib.SaveHandlerMapping(handlerID, cbPtr)
127+ return handlerID
126 }128 }
127 129
128 fcb := func(clsPtr uintptr) {130 fcb := func(clsPtr uintptr) {
@@ -135,15 +137,19 @@ func (x *GestureLongPress) ConnectCancelled(cb *func(GestureLongPress)) uint32 {
135 }137 }
136 cbRefPtr := purego.NewCallback(fcb)138 cbRefPtr := purego.NewCallback(fcb)
137 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)139 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
138- return gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)140+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancelled", cbRefPtr)
141+ glib.SaveHandlerMapping(handlerID, cbPtr)
142+ return handlerID
139 }143 }
140 144
141 // Emitted whenever a press goes unmoved/unreleased longer than145 // Emitted whenever a press goes unmoved/unreleased longer than
142 // what the GTK defaults tell.146 // what the GTK defaults tell.
143-func (x *GestureLongPress) ConnectPressed(cb *func(GestureLongPress, float64, float64)) uint32 {147+func (x *GestureLongPress) ConnectPressed(cb *func(GestureLongPress, float64, float64)) uint {
144 cbPtr := uintptr(unsafe.Pointer(cb))148 cbPtr := uintptr(unsafe.Pointer(cb))
145 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {149 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
146- return gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)150+ handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
151+ glib.SaveHandlerMapping(handlerID, cbPtr)
152+ return handlerID
147 }153 }
148 154
149 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {155 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -156,7 +162,9 @@ func (x *GestureLongPress) ConnectPressed(cb *func(GestureLongPress, float64, fl
156 }162 }
157 cbRefPtr := purego.NewCallback(fcb)163 cbRefPtr := purego.NewCallback(fcb)
158 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)164 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
159- return gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)165+ handlerID := gobject.SignalConnect(x.GoPointer(), "pressed", cbRefPtr)
166+ glib.SaveHandlerMapping(handlerID, cbPtr)
167+ return handlerID
160 }168 }
161 169
162 func init() {170 func init() {
M v4/gtk/gtkgesturepan.go +7 -3
@@ -97,10 +97,12 @@ func (c *GesturePan) SetGoPointer(ptr uintptr) {
97 }97 }
98 98
99 // Emitted once a panning gesture along the expected axis is detected.99 // Emitted once a panning gesture along the expected axis is detected.
100-func (x *GesturePan) ConnectPan(cb *func(GesturePan, PanDirection, float64)) uint32 {100+func (x *GesturePan) ConnectPan(cb *func(GesturePan, PanDirection, float64)) uint {
101 cbPtr := uintptr(unsafe.Pointer(cb))101 cbPtr := uintptr(unsafe.Pointer(cb))
102 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {102 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
103- return gobject.SignalConnect(x.GoPointer(), "pan", cbRefPtr)103+ handlerID := gobject.SignalConnect(x.GoPointer(), "pan", cbRefPtr)
104+ glib.SaveHandlerMapping(handlerID, cbPtr)
105+ return handlerID
104 }106 }
105 107
106 fcb := func(clsPtr uintptr, DirectionVarp PanDirection, OffsetVarp float64) {108 fcb := func(clsPtr uintptr, DirectionVarp PanDirection, OffsetVarp float64) {
@@ -113,7 +115,9 @@ func (x *GesturePan) ConnectPan(cb *func(GesturePan, PanDirection, float64)) uin
113 }115 }
114 cbRefPtr := purego.NewCallback(fcb)116 cbRefPtr := purego.NewCallback(fcb)
115 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)117 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
116- return gobject.SignalConnect(x.GoPointer(), "pan", cbRefPtr)118+ handlerID := gobject.SignalConnect(x.GoPointer(), "pan", cbRefPtr)
119+ glib.SaveHandlerMapping(handlerID, cbPtr)
120+ return handlerID
117 }121 }
118 122
119 func init() {123 func init() {
M v4/gtk/gtkgesturerotate.go +7 -3
@@ -83,10 +83,12 @@ func (c *GestureRotate) SetGoPointer(ptr uintptr) {
83 }83 }
84 84
85 // Emitted when the angle between both tracked points changes.85 // Emitted when the angle between both tracked points changes.
86-func (x *GestureRotate) ConnectAngleChanged(cb *func(GestureRotate, float64, float64)) uint32 {86+func (x *GestureRotate) ConnectAngleChanged(cb *func(GestureRotate, float64, float64)) uint {
87 cbPtr := uintptr(unsafe.Pointer(cb))87 cbPtr := uintptr(unsafe.Pointer(cb))
88 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {88 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
89- return gobject.SignalConnect(x.GoPointer(), "angle-changed", cbRefPtr)89+ handlerID := gobject.SignalConnect(x.GoPointer(), "angle-changed", cbRefPtr)
90+ glib.SaveHandlerMapping(handlerID, cbPtr)
91+ return handlerID
90 }92 }
91 93
92 fcb := func(clsPtr uintptr, AngleVarp float64, AngleDeltaVarp float64) {94 fcb := func(clsPtr uintptr, AngleVarp float64, AngleDeltaVarp float64) {
@@ -99,7 +101,9 @@ func (x *GestureRotate) ConnectAngleChanged(cb *func(GestureRotate, float64, flo
99 }101 }
100 cbRefPtr := purego.NewCallback(fcb)102 cbRefPtr := purego.NewCallback(fcb)
101 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)103 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
102- return gobject.SignalConnect(x.GoPointer(), "angle-changed", cbRefPtr)104+ handlerID := gobject.SignalConnect(x.GoPointer(), "angle-changed", cbRefPtr)
105+ glib.SaveHandlerMapping(handlerID, cbPtr)
106+ return handlerID
103 }107 }
104 108
105 func init() {109 func init() {
M v4/gtk/gtkgesturestylus.go +28 -12
@@ -185,10 +185,12 @@ func (x *GestureStylus) GetPropertyStylusOnly() bool {
185 }185 }
186 186
187 // Emitted when the stylus touches the device.187 // Emitted when the stylus touches the device.
188-func (x *GestureStylus) ConnectDown(cb *func(GestureStylus, float64, float64)) uint32 {188+func (x *GestureStylus) ConnectDown(cb *func(GestureStylus, float64, float64)) uint {
189 cbPtr := uintptr(unsafe.Pointer(cb))189 cbPtr := uintptr(unsafe.Pointer(cb))
190 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {190 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
191- return gobject.SignalConnect(x.GoPointer(), "down", cbRefPtr)191+ handlerID := gobject.SignalConnect(x.GoPointer(), "down", cbRefPtr)
192+ glib.SaveHandlerMapping(handlerID, cbPtr)
193+ return handlerID
192 }194 }
193 195
194 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {196 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -201,14 +203,18 @@ func (x *GestureStylus) ConnectDown(cb *func(GestureStylus, float64, float64)) u
201 }203 }
202 cbRefPtr := purego.NewCallback(fcb)204 cbRefPtr := purego.NewCallback(fcb)
203 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)205 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
204- return gobject.SignalConnect(x.GoPointer(), "down", cbRefPtr)206+ handlerID := gobject.SignalConnect(x.GoPointer(), "down", cbRefPtr)
207+ glib.SaveHandlerMapping(handlerID, cbPtr)
208+ return handlerID
205 }209 }
206 210
207 // Emitted when the stylus moves while touching the device.211 // Emitted when the stylus moves while touching the device.
208-func (x *GestureStylus) ConnectMotion(cb *func(GestureStylus, float64, float64)) uint32 {212+func (x *GestureStylus) ConnectMotion(cb *func(GestureStylus, float64, float64)) uint {
209 cbPtr := uintptr(unsafe.Pointer(cb))213 cbPtr := uintptr(unsafe.Pointer(cb))
210 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {214 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
211- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)215+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
216+ glib.SaveHandlerMapping(handlerID, cbPtr)
217+ return handlerID
212 }218 }
213 219
214 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {220 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -221,14 +227,18 @@ func (x *GestureStylus) ConnectMotion(cb *func(GestureStylus, float64, float64))
221 }227 }
222 cbRefPtr := purego.NewCallback(fcb)228 cbRefPtr := purego.NewCallback(fcb)
223 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)229 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
224- return gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)230+ handlerID := gobject.SignalConnect(x.GoPointer(), "motion", cbRefPtr)
231+ glib.SaveHandlerMapping(handlerID, cbPtr)
232+ return handlerID
225 }233 }
226 234
227 // Emitted when the stylus is in proximity of the device.235 // Emitted when the stylus is in proximity of the device.
228-func (x *GestureStylus) ConnectProximity(cb *func(GestureStylus, float64, float64)) uint32 {236+func (x *GestureStylus) ConnectProximity(cb *func(GestureStylus, float64, float64)) uint {
229 cbPtr := uintptr(unsafe.Pointer(cb))237 cbPtr := uintptr(unsafe.Pointer(cb))
230 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {238 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
231- return gobject.SignalConnect(x.GoPointer(), "proximity", cbRefPtr)239+ handlerID := gobject.SignalConnect(x.GoPointer(), "proximity", cbRefPtr)
240+ glib.SaveHandlerMapping(handlerID, cbPtr)
241+ return handlerID
232 }242 }
233 243
234 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {244 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -241,14 +251,18 @@ func (x *GestureStylus) ConnectProximity(cb *func(GestureStylus, float64, float6
241 }251 }
242 cbRefPtr := purego.NewCallback(fcb)252 cbRefPtr := purego.NewCallback(fcb)
243 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)253 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
244- return gobject.SignalConnect(x.GoPointer(), "proximity", cbRefPtr)254+ handlerID := gobject.SignalConnect(x.GoPointer(), "proximity", cbRefPtr)
255+ glib.SaveHandlerMapping(handlerID, cbPtr)
256+ return handlerID
245 }257 }
246 258
247 // Emitted when the stylus no longer touches the device.259 // Emitted when the stylus no longer touches the device.
248-func (x *GestureStylus) ConnectUp(cb *func(GestureStylus, float64, float64)) uint32 {260+func (x *GestureStylus) ConnectUp(cb *func(GestureStylus, float64, float64)) uint {
249 cbPtr := uintptr(unsafe.Pointer(cb))261 cbPtr := uintptr(unsafe.Pointer(cb))
250 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {262 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
251- return gobject.SignalConnect(x.GoPointer(), "up", cbRefPtr)263+ handlerID := gobject.SignalConnect(x.GoPointer(), "up", cbRefPtr)
264+ glib.SaveHandlerMapping(handlerID, cbPtr)
265+ return handlerID
252 }266 }
253 267
254 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {268 fcb := func(clsPtr uintptr, XVarp float64, YVarp float64) {
@@ -261,7 +275,9 @@ func (x *GestureStylus) ConnectUp(cb *func(GestureStylus, float64, float64)) uin
261 }275 }
262 cbRefPtr := purego.NewCallback(fcb)276 cbRefPtr := purego.NewCallback(fcb)
263 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)277 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
264- return gobject.SignalConnect(x.GoPointer(), "up", cbRefPtr)278+ handlerID := gobject.SignalConnect(x.GoPointer(), "up", cbRefPtr)
279+ glib.SaveHandlerMapping(handlerID, cbPtr)
280+ return handlerID
265 }281 }
266 282
267 func init() {283 func init() {
M v4/gtk/gtkgestureswipe.go +7 -3
@@ -92,10 +92,12 @@ func (c *GestureSwipe) SetGoPointer(ptr uintptr) {
92 // Emitted when the recognized gesture is finished.92 // Emitted when the recognized gesture is finished.
93 //93 //
94 // Velocity and direction are a product of previously recorded events.94 // Velocity and direction are a product of previously recorded events.
95-func (x *GestureSwipe) ConnectSwipe(cb *func(GestureSwipe, float64, float64)) uint32 {95+func (x *GestureSwipe) ConnectSwipe(cb *func(GestureSwipe, float64, float64)) uint {
96 cbPtr := uintptr(unsafe.Pointer(cb))96 cbPtr := uintptr(unsafe.Pointer(cb))
97 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {97 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
98- return gobject.SignalConnect(x.GoPointer(), "swipe", cbRefPtr)98+ handlerID := gobject.SignalConnect(x.GoPointer(), "swipe", cbRefPtr)
99+ glib.SaveHandlerMapping(handlerID, cbPtr)
100+ return handlerID
99 }101 }
100 102
101 fcb := func(clsPtr uintptr, VelocityXVarp float64, VelocityYVarp float64) {103 fcb := func(clsPtr uintptr, VelocityXVarp float64, VelocityYVarp float64) {
@@ -108,7 +110,9 @@ func (x *GestureSwipe) ConnectSwipe(cb *func(GestureSwipe, float64, float64)) ui
108 }110 }
109 cbRefPtr := purego.NewCallback(fcb)111 cbRefPtr := purego.NewCallback(fcb)
110 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)112 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
111- return gobject.SignalConnect(x.GoPointer(), "swipe", cbRefPtr)113+ handlerID := gobject.SignalConnect(x.GoPointer(), "swipe", cbRefPtr)
114+ glib.SaveHandlerMapping(handlerID, cbPtr)
115+ return handlerID
112 }116 }
113 117
114 func init() {118 func init() {
M v4/gtk/gtkgesturezoom.go +7 -3
@@ -85,10 +85,12 @@ func (c *GestureZoom) SetGoPointer(ptr uintptr) {
85 }85 }
86 86
87 // Emitted whenever the distance between both tracked sequences changes.87 // Emitted whenever the distance between both tracked sequences changes.
88-func (x *GestureZoom) ConnectScaleChanged(cb *func(GestureZoom, float64)) uint32 {88+func (x *GestureZoom) ConnectScaleChanged(cb *func(GestureZoom, float64)) uint {
89 cbPtr := uintptr(unsafe.Pointer(cb))89 cbPtr := uintptr(unsafe.Pointer(cb))
90 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {90 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
91- return gobject.SignalConnect(x.GoPointer(), "scale-changed", cbRefPtr)91+ handlerID := gobject.SignalConnect(x.GoPointer(), "scale-changed", cbRefPtr)
92+ glib.SaveHandlerMapping(handlerID, cbPtr)
93+ return handlerID
92 }94 }
93 95
94 fcb := func(clsPtr uintptr, ScaleVarp float64) {96 fcb := func(clsPtr uintptr, ScaleVarp float64) {
@@ -101,7 +103,9 @@ func (x *GestureZoom) ConnectScaleChanged(cb *func(GestureZoom, float64)) uint32
101 }103 }
102 cbRefPtr := purego.NewCallback(fcb)104 cbRefPtr := purego.NewCallback(fcb)
103 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)105 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
104- return gobject.SignalConnect(x.GoPointer(), "scale-changed", cbRefPtr)106+ handlerID := gobject.SignalConnect(x.GoPointer(), "scale-changed", cbRefPtr)
107+ glib.SaveHandlerMapping(handlerID, cbPtr)
108+ return handlerID
105 }109 }
106 110
107 func init() {111 func init() {
M v4/gtk/gtkglarea.go +21 -9
@@ -641,10 +641,12 @@ func (x *GLArea) GetPropertyUseEs() bool {
641 // If context creation fails then the signal handler can use641 // If context creation fails then the signal handler can use
642 // [method@Gtk.GLArea.set_error] to register a more detailed error642 // [method@Gtk.GLArea.set_error] to register a more detailed error
643 // of how the construction failed.643 // of how the construction failed.
644-func (x *GLArea) ConnectCreateContext(cb *func(GLArea) gdk.GLContext) uint32 {644+func (x *GLArea) ConnectCreateContext(cb *func(GLArea) gdk.GLContext) uint {
645 cbPtr := uintptr(unsafe.Pointer(cb))645 cbPtr := uintptr(unsafe.Pointer(cb))
646 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {646 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
647- return gobject.SignalConnect(x.GoPointer(), "create-context", cbRefPtr)647+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-context", cbRefPtr)
648+ glib.SaveHandlerMapping(handlerID, cbPtr)
649+ return handlerID
648 }650 }
649 651
650 fcb := func(clsPtr uintptr) uintptr {652 fcb := func(clsPtr uintptr) uintptr {
@@ -658,17 +660,21 @@ func (x *GLArea) ConnectCreateContext(cb *func(GLArea) gdk.GLContext) uint32 {
658 }660 }
659 cbRefPtr := purego.NewCallback(fcb)661 cbRefPtr := purego.NewCallback(fcb)
660 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)662 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
661- return gobject.SignalConnect(x.GoPointer(), "create-context", cbRefPtr)663+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-context", cbRefPtr)
664+ glib.SaveHandlerMapping(handlerID, cbPtr)
665+ return handlerID
662 }666 }
663 667
664 // Emitted every time the contents of the `GtkGLArea` should be redrawn.668 // Emitted every time the contents of the `GtkGLArea` should be redrawn.
665 //669 //
666 // The @context is bound to the @area prior to emitting this function,670 // The @context is bound to the @area prior to emitting this function,
667 // and the buffers are painted to the window once the emission terminates.671 // and the buffers are painted to the window once the emission terminates.
668-func (x *GLArea) ConnectRender(cb *func(GLArea, uintptr) bool) uint32 {672+func (x *GLArea) ConnectRender(cb *func(GLArea, uintptr) bool) uint {
669 cbPtr := uintptr(unsafe.Pointer(cb))673 cbPtr := uintptr(unsafe.Pointer(cb))
670 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {674 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
671- return gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)675+ handlerID := gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)
676+ glib.SaveHandlerMapping(handlerID, cbPtr)
677+ return handlerID
672 }678 }
673 679
674 fcb := func(clsPtr uintptr, ContextVarp uintptr) bool {680 fcb := func(clsPtr uintptr, ContextVarp uintptr) bool {
@@ -681,7 +687,9 @@ func (x *GLArea) ConnectRender(cb *func(GLArea, uintptr) bool) uint32 {
681 }687 }
682 cbRefPtr := purego.NewCallback(fcb)688 cbRefPtr := purego.NewCallback(fcb)
683 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)689 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
684- return gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)690+ handlerID := gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr)
691+ glib.SaveHandlerMapping(handlerID, cbPtr)
692+ return handlerID
685 }693 }
686 694
687 // Emitted once when the widget is realized, and then each time the widget695 // Emitted once when the widget is realized, and then each time the widget
@@ -695,10 +703,12 @@ func (x *GLArea) ConnectRender(cb *func(GLArea, uintptr) bool) uint32 {
695 // is emitted.703 // is emitted.
696 //704 //
697 // The default handler sets up the GL viewport.705 // The default handler sets up the GL viewport.
698-func (x *GLArea) ConnectResize(cb *func(GLArea, int, int)) uint32 {706+func (x *GLArea) ConnectResize(cb *func(GLArea, int, int)) uint {
699 cbPtr := uintptr(unsafe.Pointer(cb))707 cbPtr := uintptr(unsafe.Pointer(cb))
700 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {708 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
701- return gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)709+ handlerID := gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)
710+ glib.SaveHandlerMapping(handlerID, cbPtr)
711+ return handlerID
702 }712 }
703 713
704 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {714 fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) {
@@ -711,7 +721,9 @@ func (x *GLArea) ConnectResize(cb *func(GLArea, int, int)) uint32 {
711 }721 }
712 cbRefPtr := purego.NewCallback(fcb)722 cbRefPtr := purego.NewCallback(fcb)
713 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)723 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
714- return gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)724+ handlerID := gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr)
725+ glib.SaveHandlerMapping(handlerID, cbPtr)
726+ return handlerID
715 }727 }
716 728
717 // Requests the user's screen reader to announce the given message.729 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkgridview.go +7 -3
@@ -370,10 +370,12 @@ func (x *GridView) GetPropertySingleClickActivate() bool {
370 // This allows for a convenient way to handle activation in a gridview.370 // This allows for a convenient way to handle activation in a gridview.
371 // See [property@Gtk.ListItem:activatable] for details on how to use371 // See [property@Gtk.ListItem:activatable] for details on how to use
372 // this signal.372 // this signal.
373-func (x *GridView) ConnectActivate(cb *func(GridView, uint)) uint32 {373+func (x *GridView) ConnectActivate(cb *func(GridView, uint)) uint {
374 cbPtr := uintptr(unsafe.Pointer(cb))374 cbPtr := uintptr(unsafe.Pointer(cb))
375 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {375 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
376- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)376+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
377+ glib.SaveHandlerMapping(handlerID, cbPtr)
378+ return handlerID
377 }379 }
378 380
379 fcb := func(clsPtr uintptr, PositionVarp uint) {381 fcb := func(clsPtr uintptr, PositionVarp uint) {
@@ -386,7 +388,9 @@ func (x *GridView) ConnectActivate(cb *func(GridView, uint)) uint32 {
386 }388 }
387 cbRefPtr := purego.NewCallback(fcb)389 cbRefPtr := purego.NewCallback(fcb)
388 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)390 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
389- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)391+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
392+ glib.SaveHandlerMapping(handlerID, cbPtr)
393+ return handlerID
390 }394 }
391 395
392 // Requests the user's screen reader to announce the given message.396 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkicontheme.go +7 -3
@@ -478,10 +478,12 @@ func (x *IconTheme) GetPropertyThemeName() string {
478 // This can happen because current icon theme is switched or478 // This can happen because current icon theme is switched or
479 // because GTK detects that a change has occurred in the479 // because GTK detects that a change has occurred in the
480 // contents of the current icon theme.480 // contents of the current icon theme.
481-func (x *IconTheme) ConnectChanged(cb *func(IconTheme)) uint32 {481+func (x *IconTheme) ConnectChanged(cb *func(IconTheme)) uint {
482 cbPtr := uintptr(unsafe.Pointer(cb))482 cbPtr := uintptr(unsafe.Pointer(cb))
483 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {483 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
484- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)484+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
485+ glib.SaveHandlerMapping(handlerID, cbPtr)
486+ return handlerID
485 }487 }
486 488
487 fcb := func(clsPtr uintptr) {489 fcb := func(clsPtr uintptr) {
@@ -494,7 +496,9 @@ func (x *IconTheme) ConnectChanged(cb *func(IconTheme)) uint32 {
494 }496 }
495 cbRefPtr := purego.NewCallback(fcb)497 cbRefPtr := purego.NewCallback(fcb)
496 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)498 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
497- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)499+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
500+ glib.SaveHandlerMapping(handlerID, cbPtr)
501+ return handlerID
498 }502 }
499 503
500 var xIconThemeGetForDisplay func(uintptr) uintptr504 var xIconThemeGetForDisplay func(uintptr) uintptr
M v4/gtk/gtkiconview.go +56 -24
@@ -1139,10 +1139,12 @@ func (x *IconView) GetPropertyTooltipColumn() int {
1139 // programmatically.1139 // programmatically.
1140 //1140 //
1141 // The default bindings for this signal are Space, Return and Enter.1141 // The default bindings for this signal are Space, Return and Enter.
1142-func (x *IconView) ConnectActivateCursorItem(cb *func(IconView) bool) uint32 {1142+func (x *IconView) ConnectActivateCursorItem(cb *func(IconView) bool) uint {
1143 cbPtr := uintptr(unsafe.Pointer(cb))1143 cbPtr := uintptr(unsafe.Pointer(cb))
1144 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1144 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1145- return gobject.SignalConnect(x.GoPointer(), "activate-cursor-item", cbRefPtr)1145+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-item", cbRefPtr)
1146+ glib.SaveHandlerMapping(handlerID, cbPtr)
1147+ return handlerID
1146 }1148 }
1147 1149
1148 fcb := func(clsPtr uintptr) bool {1150 fcb := func(clsPtr uintptr) bool {
@@ -1155,7 +1157,9 @@ func (x *IconView) ConnectActivateCursorItem(cb *func(IconView) bool) uint32 {
1155 }1157 }
1156 cbRefPtr := purego.NewCallback(fcb)1158 cbRefPtr := purego.NewCallback(fcb)
1157 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1159 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1158- return gobject.SignalConnect(x.GoPointer(), "activate-cursor-item", cbRefPtr)1160+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-item", cbRefPtr)
1161+ glib.SaveHandlerMapping(handlerID, cbPtr)
1162+ return handlerID
1159 }1163 }
1160 1164
1161 // The ::item-activated signal is emitted when the method1165 // The ::item-activated signal is emitted when the method
@@ -1165,10 +1169,12 @@ func (x *IconView) ConnectActivateCursorItem(cb *func(IconView) bool) uint32 {
1165 // "activate-on-single-click" property set to %TRUE. It is also1169 // "activate-on-single-click" property set to %TRUE. It is also
1166 // emitted when a non-editable item is selected and one of the keys:1170 // emitted when a non-editable item is selected and one of the keys:
1167 // Space, Return or Enter is pressed.1171 // Space, Return or Enter is pressed.
1168-func (x *IconView) ConnectItemActivated(cb *func(IconView, uintptr)) uint32 {1172+func (x *IconView) ConnectItemActivated(cb *func(IconView, uintptr)) uint {
1169 cbPtr := uintptr(unsafe.Pointer(cb))1173 cbPtr := uintptr(unsafe.Pointer(cb))
1170 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1174 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1171- return gobject.SignalConnect(x.GoPointer(), "item-activated", cbRefPtr)1175+ handlerID := gobject.SignalConnect(x.GoPointer(), "item-activated", cbRefPtr)
1176+ glib.SaveHandlerMapping(handlerID, cbPtr)
1177+ return handlerID
1172 }1178 }
1173 1179
1174 fcb := func(clsPtr uintptr, PathVarp uintptr) {1180 fcb := func(clsPtr uintptr, PathVarp uintptr) {
@@ -1181,7 +1187,9 @@ func (x *IconView) ConnectItemActivated(cb *func(IconView, uintptr)) uint32 {
1181 }1187 }
1182 cbRefPtr := purego.NewCallback(fcb)1188 cbRefPtr := purego.NewCallback(fcb)
1183 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1189 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1184- return gobject.SignalConnect(x.GoPointer(), "item-activated", cbRefPtr)1190+ handlerID := gobject.SignalConnect(x.GoPointer(), "item-activated", cbRefPtr)
1191+ glib.SaveHandlerMapping(handlerID, cbPtr)
1192+ return handlerID
1185 }1193 }
1186 1194
1187 // The ::move-cursor signal is a1195 // The ::move-cursor signal is a
@@ -1198,10 +1206,12 @@ func (x *IconView) ConnectItemActivated(cb *func(IconView, uintptr)) uint32 {
1198 // - PageUp/PageDown which move by "pages"1206 // - PageUp/PageDown which move by "pages"
1199 // All of these will extend the selection when combined with1207 // All of these will extend the selection when combined with
1200 // the Shift modifier.1208 // the Shift modifier.
1201-func (x *IconView) ConnectMoveCursor(cb *func(IconView, MovementStep, int, bool, bool) bool) uint32 {1209+func (x *IconView) ConnectMoveCursor(cb *func(IconView, MovementStep, int, bool, bool) bool) uint {
1202 cbPtr := uintptr(unsafe.Pointer(cb))1210 cbPtr := uintptr(unsafe.Pointer(cb))
1203 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1211 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1204- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)1212+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
1213+ glib.SaveHandlerMapping(handlerID, cbPtr)
1214+ return handlerID
1205 }1215 }
1206 1216
1207 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) bool {1217 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) bool {
@@ -1214,7 +1224,9 @@ func (x *IconView) ConnectMoveCursor(cb *func(IconView, MovementStep, int, bool,
1214 }1224 }
1215 cbRefPtr := purego.NewCallback(fcb)1225 cbRefPtr := purego.NewCallback(fcb)
1216 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1226 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1217- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)1227+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
1228+ glib.SaveHandlerMapping(handlerID, cbPtr)
1229+ return handlerID
1218 }1230 }
1219 1231
1220 // A [keybinding signal][class@Gtk.SignalAction]1232 // A [keybinding signal][class@Gtk.SignalAction]
@@ -1225,10 +1237,12 @@ func (x *IconView) ConnectMoveCursor(cb *func(IconView, MovementStep, int, bool,
1225 // programmatically.1237 // programmatically.
1226 //1238 //
1227 // The default binding for this signal is Ctrl-a.1239 // The default binding for this signal is Ctrl-a.
1228-func (x *IconView) ConnectSelectAll(cb *func(IconView)) uint32 {1240+func (x *IconView) ConnectSelectAll(cb *func(IconView)) uint {
1229 cbPtr := uintptr(unsafe.Pointer(cb))1241 cbPtr := uintptr(unsafe.Pointer(cb))
1230 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1242 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1231- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)1243+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
1244+ glib.SaveHandlerMapping(handlerID, cbPtr)
1245+ return handlerID
1232 }1246 }
1233 1247
1234 fcb := func(clsPtr uintptr) {1248 fcb := func(clsPtr uintptr) {
@@ -1241,7 +1255,9 @@ func (x *IconView) ConnectSelectAll(cb *func(IconView)) uint32 {
1241 }1255 }
1242 cbRefPtr := purego.NewCallback(fcb)1256 cbRefPtr := purego.NewCallback(fcb)
1243 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1257 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1244- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)1258+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
1259+ glib.SaveHandlerMapping(handlerID, cbPtr)
1260+ return handlerID
1245 }1261 }
1246 1262
1247 // A [keybinding signal][class@Gtk.SignalAction]1263 // A [keybinding signal][class@Gtk.SignalAction]
@@ -1253,10 +1269,12 @@ func (x *IconView) ConnectSelectAll(cb *func(IconView)) uint32 {
1253 // programmatically.1269 // programmatically.
1254 //1270 //
1255 // There is no default binding for this signal.1271 // There is no default binding for this signal.
1256-func (x *IconView) ConnectSelectCursorItem(cb *func(IconView)) uint32 {1272+func (x *IconView) ConnectSelectCursorItem(cb *func(IconView)) uint {
1257 cbPtr := uintptr(unsafe.Pointer(cb))1273 cbPtr := uintptr(unsafe.Pointer(cb))
1258 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1274 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1259- return gobject.SignalConnect(x.GoPointer(), "select-cursor-item", cbRefPtr)1275+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-cursor-item", cbRefPtr)
1276+ glib.SaveHandlerMapping(handlerID, cbPtr)
1277+ return handlerID
1260 }1278 }
1261 1279
1262 fcb := func(clsPtr uintptr) {1280 fcb := func(clsPtr uintptr) {
@@ -1269,15 +1287,19 @@ func (x *IconView) ConnectSelectCursorItem(cb *func(IconView)) uint32 {
1269 }1287 }
1270 cbRefPtr := purego.NewCallback(fcb)1288 cbRefPtr := purego.NewCallback(fcb)
1271 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1289 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1272- return gobject.SignalConnect(x.GoPointer(), "select-cursor-item", cbRefPtr)1290+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-cursor-item", cbRefPtr)
1291+ glib.SaveHandlerMapping(handlerID, cbPtr)
1292+ return handlerID
1273 }1293 }
1274 1294
1275 // The ::selection-changed signal is emitted when the selection1295 // The ::selection-changed signal is emitted when the selection
1276 // (i.e. the set of selected items) changes.1296 // (i.e. the set of selected items) changes.
1277-func (x *IconView) ConnectSelectionChanged(cb *func(IconView)) uint32 {1297+func (x *IconView) ConnectSelectionChanged(cb *func(IconView)) uint {
1278 cbPtr := uintptr(unsafe.Pointer(cb))1298 cbPtr := uintptr(unsafe.Pointer(cb))
1279 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1299 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1280- return gobject.SignalConnect(x.GoPointer(), "selection-changed", cbRefPtr)1300+ handlerID := gobject.SignalConnect(x.GoPointer(), "selection-changed", cbRefPtr)
1301+ glib.SaveHandlerMapping(handlerID, cbPtr)
1302+ return handlerID
1281 }1303 }
1282 1304
1283 fcb := func(clsPtr uintptr) {1305 fcb := func(clsPtr uintptr) {
@@ -1290,7 +1312,9 @@ func (x *IconView) ConnectSelectionChanged(cb *func(IconView)) uint32 {
1290 }1312 }
1291 cbRefPtr := purego.NewCallback(fcb)1313 cbRefPtr := purego.NewCallback(fcb)
1292 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1314 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1293- return gobject.SignalConnect(x.GoPointer(), "selection-changed", cbRefPtr)1315+ handlerID := gobject.SignalConnect(x.GoPointer(), "selection-changed", cbRefPtr)
1316+ glib.SaveHandlerMapping(handlerID, cbPtr)
1317+ return handlerID
1294 }1318 }
1295 1319
1296 // A [keybinding signal][class@Gtk.SignalAction]1320 // A [keybinding signal][class@Gtk.SignalAction]
@@ -1303,10 +1327,12 @@ func (x *IconView) ConnectSelectionChanged(cb *func(IconView)) uint32 {
1303 // programmatically.1327 // programmatically.
1304 //1328 //
1305 // There is no default binding for this signal is Ctrl-Space.1329 // There is no default binding for this signal is Ctrl-Space.
1306-func (x *IconView) ConnectToggleCursorItem(cb *func(IconView)) uint32 {1330+func (x *IconView) ConnectToggleCursorItem(cb *func(IconView)) uint {
1307 cbPtr := uintptr(unsafe.Pointer(cb))1331 cbPtr := uintptr(unsafe.Pointer(cb))
1308 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1332 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1309- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-item", cbRefPtr)1333+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-item", cbRefPtr)
1334+ glib.SaveHandlerMapping(handlerID, cbPtr)
1335+ return handlerID
1310 }1336 }
1311 1337
1312 fcb := func(clsPtr uintptr) {1338 fcb := func(clsPtr uintptr) {
@@ -1319,7 +1345,9 @@ func (x *IconView) ConnectToggleCursorItem(cb *func(IconView)) uint32 {
1319 }1345 }
1320 cbRefPtr := purego.NewCallback(fcb)1346 cbRefPtr := purego.NewCallback(fcb)
1321 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1347 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1322- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-item", cbRefPtr)1348+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-item", cbRefPtr)
1349+ glib.SaveHandlerMapping(handlerID, cbPtr)
1350+ return handlerID
1323 }1351 }
1324 1352
1325 // A [keybinding signal][class@Gtk.SignalAction]1353 // A [keybinding signal][class@Gtk.SignalAction]
@@ -1330,10 +1358,12 @@ func (x *IconView) ConnectToggleCursorItem(cb *func(IconView)) uint32 {
1330 // programmatically.1358 // programmatically.
1331 //1359 //
1332 // The default binding for this signal is Ctrl-Shift-a.1360 // The default binding for this signal is Ctrl-Shift-a.
1333-func (x *IconView) ConnectUnselectAll(cb *func(IconView)) uint32 {1361+func (x *IconView) ConnectUnselectAll(cb *func(IconView)) uint {
1334 cbPtr := uintptr(unsafe.Pointer(cb))1362 cbPtr := uintptr(unsafe.Pointer(cb))
1335 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1363 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1336- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)1364+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1365+ glib.SaveHandlerMapping(handlerID, cbPtr)
1366+ return handlerID
1337 }1367 }
1338 1368
1339 fcb := func(clsPtr uintptr) {1369 fcb := func(clsPtr uintptr) {
@@ -1346,7 +1376,9 @@ func (x *IconView) ConnectUnselectAll(cb *func(IconView)) uint32 {
1346 }1376 }
1347 cbRefPtr := purego.NewCallback(fcb)1377 cbRefPtr := purego.NewCallback(fcb)
1348 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1378 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1349- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)1379+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1380+ glib.SaveHandlerMapping(handlerID, cbPtr)
1381+ return handlerID
1350 }1382 }
1351 1383
1352 // Requests the user's screen reader to announce the given message.1384 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkimcontext.go +42 -18
@@ -1058,10 +1058,12 @@ func (c *IMContext) SetGoPointer(ptr uintptr) {
1058 //1058 //
1059 // This can be a single character immediately after a key press or1059 // This can be a single character immediately after a key press or
1060 // the final result of preediting.1060 // the final result of preediting.
1061-func (x *IMContext) ConnectCommit(cb *func(IMContext, string)) uint32 {1061+func (x *IMContext) ConnectCommit(cb *func(IMContext, string)) uint {
1062 cbPtr := uintptr(unsafe.Pointer(cb))1062 cbPtr := uintptr(unsafe.Pointer(cb))
1063 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1063 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1064- return gobject.SignalConnect(x.GoPointer(), "commit", cbRefPtr)1064+ handlerID := gobject.SignalConnect(x.GoPointer(), "commit", cbRefPtr)
1065+ glib.SaveHandlerMapping(handlerID, cbPtr)
1066+ return handlerID
1065 }1067 }
1066 1068
1067 fcb := func(clsPtr uintptr, StrVarp string) {1069 fcb := func(clsPtr uintptr, StrVarp string) {
@@ -1074,15 +1076,19 @@ func (x *IMContext) ConnectCommit(cb *func(IMContext, string)) uint32 {
1074 }1076 }
1075 cbRefPtr := purego.NewCallback(fcb)1077 cbRefPtr := purego.NewCallback(fcb)
1076 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1078 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1077- return gobject.SignalConnect(x.GoPointer(), "commit", cbRefPtr)1079+ handlerID := gobject.SignalConnect(x.GoPointer(), "commit", cbRefPtr)
1080+ glib.SaveHandlerMapping(handlerID, cbPtr)
1081+ return handlerID
1078 }1082 }
1079 1083
1080 // The ::delete-surrounding signal is emitted when the input method1084 // The ::delete-surrounding signal is emitted when the input method
1081 // needs to delete all or part of the context surrounding the cursor.1085 // needs to delete all or part of the context surrounding the cursor.
1082-func (x *IMContext) ConnectDeleteSurrounding(cb *func(IMContext, int, int) bool) uint32 {1086+func (x *IMContext) ConnectDeleteSurrounding(cb *func(IMContext, int, int) bool) uint {
1083 cbPtr := uintptr(unsafe.Pointer(cb))1087 cbPtr := uintptr(unsafe.Pointer(cb))
1084 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1088 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1085- return gobject.SignalConnect(x.GoPointer(), "delete-surrounding", cbRefPtr)1089+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-surrounding", cbRefPtr)
1090+ glib.SaveHandlerMapping(handlerID, cbPtr)
1091+ return handlerID
1086 }1092 }
1087 1093
1088 fcb := func(clsPtr uintptr, OffsetVarp int, NCharsVarp int) bool {1094 fcb := func(clsPtr uintptr, OffsetVarp int, NCharsVarp int) bool {
@@ -1095,7 +1101,9 @@ func (x *IMContext) ConnectDeleteSurrounding(cb *func(IMContext, int, int) bool)
1095 }1101 }
1096 cbRefPtr := purego.NewCallback(fcb)1102 cbRefPtr := purego.NewCallback(fcb)
1097 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1103 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1098- return gobject.SignalConnect(x.GoPointer(), "delete-surrounding", cbRefPtr)1104+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-surrounding", cbRefPtr)
1105+ glib.SaveHandlerMapping(handlerID, cbPtr)
1106+ return handlerID
1099 }1107 }
1100 1108
1101 // The ::preedit-changed signal is emitted whenever the preedit sequence1109 // The ::preedit-changed signal is emitted whenever the preedit sequence
@@ -1103,10 +1111,12 @@ func (x *IMContext) ConnectDeleteSurrounding(cb *func(IMContext, int, int) bool)
1103 //1111 //
1104 // It is also emitted at the end of a preedit sequence, in which case1112 // It is also emitted at the end of a preedit sequence, in which case
1105 // [method@Gtk.IMContext.get_preedit_string] returns the empty string.1113 // [method@Gtk.IMContext.get_preedit_string] returns the empty string.
1106-func (x *IMContext) ConnectPreeditChanged(cb *func(IMContext)) uint32 {1114+func (x *IMContext) ConnectPreeditChanged(cb *func(IMContext)) uint {
1107 cbPtr := uintptr(unsafe.Pointer(cb))1115 cbPtr := uintptr(unsafe.Pointer(cb))
1108 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1116 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1109- return gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)1117+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
1118+ glib.SaveHandlerMapping(handlerID, cbPtr)
1119+ return handlerID
1110 }1120 }
1111 1121
1112 fcb := func(clsPtr uintptr) {1122 fcb := func(clsPtr uintptr) {
@@ -1119,15 +1129,19 @@ func (x *IMContext) ConnectPreeditChanged(cb *func(IMContext)) uint32 {
1119 }1129 }
1120 cbRefPtr := purego.NewCallback(fcb)1130 cbRefPtr := purego.NewCallback(fcb)
1121 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1131 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1122- return gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)1132+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
1133+ glib.SaveHandlerMapping(handlerID, cbPtr)
1134+ return handlerID
1123 }1135 }
1124 1136
1125 // The ::preedit-end signal is emitted when a preediting sequence1137 // The ::preedit-end signal is emitted when a preediting sequence
1126 // has been completed or canceled.1138 // has been completed or canceled.
1127-func (x *IMContext) ConnectPreeditEnd(cb *func(IMContext)) uint32 {1139+func (x *IMContext) ConnectPreeditEnd(cb *func(IMContext)) uint {
1128 cbPtr := uintptr(unsafe.Pointer(cb))1140 cbPtr := uintptr(unsafe.Pointer(cb))
1129 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1141 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1130- return gobject.SignalConnect(x.GoPointer(), "preedit-end", cbRefPtr)1142+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-end", cbRefPtr)
1143+ glib.SaveHandlerMapping(handlerID, cbPtr)
1144+ return handlerID
1131 }1145 }
1132 1146
1133 fcb := func(clsPtr uintptr) {1147 fcb := func(clsPtr uintptr) {
@@ -1140,15 +1154,19 @@ func (x *IMContext) ConnectPreeditEnd(cb *func(IMContext)) uint32 {
1140 }1154 }
1141 cbRefPtr := purego.NewCallback(fcb)1155 cbRefPtr := purego.NewCallback(fcb)
1142 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1156 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1143- return gobject.SignalConnect(x.GoPointer(), "preedit-end", cbRefPtr)1157+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-end", cbRefPtr)
1158+ glib.SaveHandlerMapping(handlerID, cbPtr)
1159+ return handlerID
1144 }1160 }
1145 1161
1146 // The ::preedit-start signal is emitted when a new preediting sequence1162 // The ::preedit-start signal is emitted when a new preediting sequence
1147 // starts.1163 // starts.
1148-func (x *IMContext) ConnectPreeditStart(cb *func(IMContext)) uint32 {1164+func (x *IMContext) ConnectPreeditStart(cb *func(IMContext)) uint {
1149 cbPtr := uintptr(unsafe.Pointer(cb))1165 cbPtr := uintptr(unsafe.Pointer(cb))
1150 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1166 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1151- return gobject.SignalConnect(x.GoPointer(), "preedit-start", cbRefPtr)1167+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-start", cbRefPtr)
1168+ glib.SaveHandlerMapping(handlerID, cbPtr)
1169+ return handlerID
1152 }1170 }
1153 1171
1154 fcb := func(clsPtr uintptr) {1172 fcb := func(clsPtr uintptr) {
@@ -1161,7 +1179,9 @@ func (x *IMContext) ConnectPreeditStart(cb *func(IMContext)) uint32 {
1161 }1179 }
1162 cbRefPtr := purego.NewCallback(fcb)1180 cbRefPtr := purego.NewCallback(fcb)
1163 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1181 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1164- return gobject.SignalConnect(x.GoPointer(), "preedit-start", cbRefPtr)1182+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-start", cbRefPtr)
1183+ glib.SaveHandlerMapping(handlerID, cbPtr)
1184+ return handlerID
1165 }1185 }
1166 1186
1167 // The ::retrieve-surrounding signal is emitted when the input method1187 // The ::retrieve-surrounding signal is emitted when the input method
@@ -1169,10 +1189,12 @@ func (x *IMContext) ConnectPreeditStart(cb *func(IMContext)) uint32 {
1169 //1189 //
1170 // The callback should set the input method surrounding context by1190 // The callback should set the input method surrounding context by
1171 // calling the [method@Gtk.IMContext.set_surrounding] method.1191 // calling the [method@Gtk.IMContext.set_surrounding] method.
1172-func (x *IMContext) ConnectRetrieveSurrounding(cb *func(IMContext) bool) uint32 {1192+func (x *IMContext) ConnectRetrieveSurrounding(cb *func(IMContext) bool) uint {
1173 cbPtr := uintptr(unsafe.Pointer(cb))1193 cbPtr := uintptr(unsafe.Pointer(cb))
1174 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1194 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1175- return gobject.SignalConnect(x.GoPointer(), "retrieve-surrounding", cbRefPtr)1195+ handlerID := gobject.SignalConnect(x.GoPointer(), "retrieve-surrounding", cbRefPtr)
1196+ glib.SaveHandlerMapping(handlerID, cbPtr)
1197+ return handlerID
1176 }1198 }
1177 1199
1178 fcb := func(clsPtr uintptr) bool {1200 fcb := func(clsPtr uintptr) bool {
@@ -1185,7 +1207,9 @@ func (x *IMContext) ConnectRetrieveSurrounding(cb *func(IMContext) bool) uint32
1185 }1207 }
1186 cbRefPtr := purego.NewCallback(fcb)1208 cbRefPtr := purego.NewCallback(fcb)
1187 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1209 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1188- return gobject.SignalConnect(x.GoPointer(), "retrieve-surrounding", cbRefPtr)1210+ handlerID := gobject.SignalConnect(x.GoPointer(), "retrieve-surrounding", cbRefPtr)
1211+ glib.SaveHandlerMapping(handlerID, cbPtr)
1212+ return handlerID
1189 }1213 }
1190 1214
1191 func init() {1215 func init() {
M v4/gtk/gtkinfobar.go +14 -6
@@ -391,10 +391,12 @@ func (x *InfoBar) GetPropertyShowCloseButton() bool {
391 // The ::close signal is a [keybinding signal](class.SignalAction.html).391 // The ::close signal is a [keybinding signal](class.SignalAction.html).
392 //392 //
393 // The default binding for this signal is the Escape key.393 // The default binding for this signal is the Escape key.
394-func (x *InfoBar) ConnectClose(cb *func(InfoBar)) uint32 {394+func (x *InfoBar) ConnectClose(cb *func(InfoBar)) uint {
395 cbPtr := uintptr(unsafe.Pointer(cb))395 cbPtr := uintptr(unsafe.Pointer(cb))
396 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {396 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
397- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)397+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
398+ glib.SaveHandlerMapping(handlerID, cbPtr)
399+ return handlerID
398 }400 }
399 401
400 fcb := func(clsPtr uintptr) {402 fcb := func(clsPtr uintptr) {
@@ -407,7 +409,9 @@ func (x *InfoBar) ConnectClose(cb *func(InfoBar)) uint32 {
407 }409 }
408 cbRefPtr := purego.NewCallback(fcb)410 cbRefPtr := purego.NewCallback(fcb)
409 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)411 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
410- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)412+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
413+ glib.SaveHandlerMapping(handlerID, cbPtr)
414+ return handlerID
411 }415 }
412 416
413 // Emitted when an action widget is clicked.417 // Emitted when an action widget is clicked.
@@ -415,10 +419,12 @@ func (x *InfoBar) ConnectClose(cb *func(InfoBar)) uint32 {
415 // The signal is also emitted when the application programmer419 // The signal is also emitted when the application programmer
416 // calls [method@Gtk.InfoBar.response]. The @response_id depends420 // calls [method@Gtk.InfoBar.response]. The @response_id depends
417 // on which action widget was clicked.421 // on which action widget was clicked.
418-func (x *InfoBar) ConnectResponse(cb *func(InfoBar, int)) uint32 {422+func (x *InfoBar) ConnectResponse(cb *func(InfoBar, int)) uint {
419 cbPtr := uintptr(unsafe.Pointer(cb))423 cbPtr := uintptr(unsafe.Pointer(cb))
420 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {424 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
421- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)425+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
426+ glib.SaveHandlerMapping(handlerID, cbPtr)
427+ return handlerID
422 }428 }
423 429
424 fcb := func(clsPtr uintptr, ResponseIdVarp int) {430 fcb := func(clsPtr uintptr, ResponseIdVarp int) {
@@ -431,7 +437,9 @@ func (x *InfoBar) ConnectResponse(cb *func(InfoBar, int)) uint32 {
431 }437 }
432 cbRefPtr := purego.NewCallback(fcb)438 cbRefPtr := purego.NewCallback(fcb)
433 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)439 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
434- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)440+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
441+ glib.SaveHandlerMapping(handlerID, cbPtr)
442+ return handlerID
435 }443 }
436 444
437 // Requests the user's screen reader to announce the given message.445 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtklabel.go +28 -12
@@ -1336,10 +1336,12 @@ func (x *Label) GetPropertyYalign() float32 {
1336 // if they need to control activation of URIs programmatically.1336 // if they need to control activation of URIs programmatically.
1337 //1337 //
1338 // The default bindings for this signal are all forms of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.1338 // The default bindings for this signal are all forms of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.
1339-func (x *Label) ConnectActivateCurrentLink(cb *func(Label)) uint32 {1339+func (x *Label) ConnectActivateCurrentLink(cb *func(Label)) uint {
1340 cbPtr := uintptr(unsafe.Pointer(cb))1340 cbPtr := uintptr(unsafe.Pointer(cb))
1341 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1341 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1342- return gobject.SignalConnect(x.GoPointer(), "activate-current-link", cbRefPtr)1342+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-current-link", cbRefPtr)
1343+ glib.SaveHandlerMapping(handlerID, cbPtr)
1344+ return handlerID
1343 }1345 }
1344 1346
1345 fcb := func(clsPtr uintptr) {1347 fcb := func(clsPtr uintptr) {
@@ -1352,17 +1354,21 @@ func (x *Label) ConnectActivateCurrentLink(cb *func(Label)) uint32 {
1352 }1354 }
1353 cbRefPtr := purego.NewCallback(fcb)1355 cbRefPtr := purego.NewCallback(fcb)
1354 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1356 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1355- return gobject.SignalConnect(x.GoPointer(), "activate-current-link", cbRefPtr)1357+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-current-link", cbRefPtr)
1358+ glib.SaveHandlerMapping(handlerID, cbPtr)
1359+ return handlerID
1356 }1360 }
1357 1361
1358 // Gets emitted to activate a URI.1362 // Gets emitted to activate a URI.
1359 //1363 //
1360 // Applications may connect to it to override the default behaviour,1364 // Applications may connect to it to override the default behaviour,
1361 // which is to call [method@Gtk.FileLauncher.launch].1365 // which is to call [method@Gtk.FileLauncher.launch].
1362-func (x *Label) ConnectActivateLink(cb *func(Label, string) bool) uint32 {1366+func (x *Label) ConnectActivateLink(cb *func(Label, string) bool) uint {
1363 cbPtr := uintptr(unsafe.Pointer(cb))1367 cbPtr := uintptr(unsafe.Pointer(cb))
1364 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1368 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1365- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)1369+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
1370+ glib.SaveHandlerMapping(handlerID, cbPtr)
1371+ return handlerID
1366 }1372 }
1367 1373
1368 fcb := func(clsPtr uintptr, UriVarp string) bool {1374 fcb := func(clsPtr uintptr, UriVarp string) bool {
@@ -1375,7 +1381,9 @@ func (x *Label) ConnectActivateLink(cb *func(Label, string) bool) uint32 {
1375 }1381 }
1376 cbRefPtr := purego.NewCallback(fcb)1382 cbRefPtr := purego.NewCallback(fcb)
1377 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1383 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1378- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)1384+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
1385+ glib.SaveHandlerMapping(handlerID, cbPtr)
1386+ return handlerID
1379 }1387 }
1380 1388
1381 // Gets emitted to copy the selection to the clipboard.1389 // Gets emitted to copy the selection to the clipboard.
@@ -1383,10 +1391,12 @@ func (x *Label) ConnectActivateLink(cb *func(Label, string) bool) uint32 {
1383 // The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html).1391 // The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html).
1384 //1392 //
1385 // The default binding for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt;.1393 // The default binding for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt;.
1386-func (x *Label) ConnectCopyClipboard(cb *func(Label)) uint32 {1394+func (x *Label) ConnectCopyClipboard(cb *func(Label)) uint {
1387 cbPtr := uintptr(unsafe.Pointer(cb))1395 cbPtr := uintptr(unsafe.Pointer(cb))
1388 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1396 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1389- return gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)1397+ handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
1398+ glib.SaveHandlerMapping(handlerID, cbPtr)
1399+ return handlerID
1390 }1400 }
1391 1401
1392 fcb := func(clsPtr uintptr) {1402 fcb := func(clsPtr uintptr) {
@@ -1399,7 +1409,9 @@ func (x *Label) ConnectCopyClipboard(cb *func(Label)) uint32 {
1399 }1409 }
1400 cbRefPtr := purego.NewCallback(fcb)1410 cbRefPtr := purego.NewCallback(fcb)
1401 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1411 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1402- return gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)1412+ handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
1413+ glib.SaveHandlerMapping(handlerID, cbPtr)
1414+ return handlerID
1403 }1415 }
1404 1416
1405 // Gets emitted when the user initiates a cursor movement.1417 // Gets emitted when the user initiates a cursor movement.
@@ -1421,10 +1433,12 @@ func (x *Label) ConnectCopyClipboard(cb *func(Label)) uint32 {
1421 // move by individual characters/lines1433 // move by individual characters/lines
1422 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, etc. move by words/paragraphs1434 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, etc. move by words/paragraphs
1423 // - &lt;kbd&gt;Home&lt;/kbd&gt; and &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the buffer1435 // - &lt;kbd&gt;Home&lt;/kbd&gt; and &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the buffer
1424-func (x *Label) ConnectMoveCursor(cb *func(Label, MovementStep, int, bool)) uint32 {1436+func (x *Label) ConnectMoveCursor(cb *func(Label, MovementStep, int, bool)) uint {
1425 cbPtr := uintptr(unsafe.Pointer(cb))1437 cbPtr := uintptr(unsafe.Pointer(cb))
1426 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1438 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1427- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)1439+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
1440+ glib.SaveHandlerMapping(handlerID, cbPtr)
1441+ return handlerID
1428 }1442 }
1429 1443
1430 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool) {1444 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool) {
@@ -1437,7 +1451,9 @@ func (x *Label) ConnectMoveCursor(cb *func(Label, MovementStep, int, bool)) uint
1437 }1451 }
1438 cbRefPtr := purego.NewCallback(fcb)1452 cbRefPtr := purego.NewCallback(fcb)
1439 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1453 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1440- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)1454+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
1455+ glib.SaveHandlerMapping(handlerID, cbPtr)
1456+ return handlerID
1441 }1457 }
1442 1458
1443 // Requests the user's screen reader to announce the given message.1459 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtklevelbar.go +14 -6
@@ -419,10 +419,12 @@ func (x *LevelBar) GetPropertyValue() float64 {
419 // The signal supports detailed connections; you can connect to the419 // The signal supports detailed connections; you can connect to the
420 // detailed signal "changed::x" in order to only receive callbacks when420 // detailed signal "changed::x" in order to only receive callbacks when
421 // the value of offset "x" changes.421 // the value of offset "x" changes.
422-func (x *LevelBar) ConnectOffsetChanged(cb *func(LevelBar, string)) uint32 {422+func (x *LevelBar) ConnectOffsetChanged(cb *func(LevelBar, string)) uint {
423 cbPtr := uintptr(unsafe.Pointer(cb))423 cbPtr := uintptr(unsafe.Pointer(cb))
424 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {424 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
425- return gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr)425+ handlerID := gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr)
426+ glib.SaveHandlerMapping(handlerID, cbPtr)
427+ return handlerID
426 }428 }
427 429
428 fcb := func(clsPtr uintptr, NameVarp string) {430 fcb := func(clsPtr uintptr, NameVarp string) {
@@ -435,16 +437,20 @@ func (x *LevelBar) ConnectOffsetChanged(cb *func(LevelBar, string)) uint32 {
435 }437 }
436 cbRefPtr := purego.NewCallback(fcb)438 cbRefPtr := purego.NewCallback(fcb)
437 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)439 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
438- return gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr)440+ handlerID := gobject.SignalConnect(x.GoPointer(), "offset-changed", cbRefPtr)
441+ glib.SaveHandlerMapping(handlerID, cbPtr)
442+ return handlerID
439 }443 }
440 444
441 // ConnectOffsetChangedWithDetail connects to the "offset-changed" signal with a detail string.445 // ConnectOffsetChangedWithDetail connects to the "offset-changed" signal with a detail string.
442 // The detail is appended as "offset-changed::<detail>".446 // The detail is appended as "offset-changed::<detail>".
443-func (x *LevelBar) ConnectOffsetChangedWithDetail(detail string, cb *func(LevelBar, string)) uint32 {447+func (x *LevelBar) ConnectOffsetChangedWithDetail(detail string, cb *func(LevelBar, string)) uint {
444 cbPtr := uintptr(unsafe.Pointer(cb))448 cbPtr := uintptr(unsafe.Pointer(cb))
445 signalName := fmt.Sprintf("offset-changed::%s", detail)449 signalName := fmt.Sprintf("offset-changed::%s", detail)
446 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {450 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
447- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)451+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
452+ glib.SaveHandlerMapping(handlerID, cbPtr)
453+ return handlerID
448 }454 }
449 455
450 fcb := func(clsPtr uintptr, NameVarp string) {456 fcb := func(clsPtr uintptr, NameVarp string) {
@@ -457,7 +463,9 @@ func (x *LevelBar) ConnectOffsetChangedWithDetail(detail string, cb *func(LevelB
457 }463 }
458 cbRefPtr := purego.NewCallback(fcb)464 cbRefPtr := purego.NewCallback(fcb)
459 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)465 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
460- return gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)466+ handlerID := gobject.SignalConnect(x.GoPointer(), signalName, cbRefPtr)
467+ glib.SaveHandlerMapping(handlerID, cbPtr)
468+ return handlerID
461 }469 }
462 470
463 // Requests the user's screen reader to announce the given message.471 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtklinkbutton.go +7 -3
@@ -214,10 +214,12 @@ func (x *LinkButton) GetPropertyVisited() bool {
214 // To override the default behavior, you can connect to the214 // To override the default behavior, you can connect to the
215 // ::activate-link signal and stop the propagation of the signal215 // ::activate-link signal and stop the propagation of the signal
216 // by returning %TRUE from your handler.216 // by returning %TRUE from your handler.
217-func (x *LinkButton) ConnectActivateLink(cb *func(LinkButton) bool) uint32 {217+func (x *LinkButton) ConnectActivateLink(cb *func(LinkButton) bool) uint {
218 cbPtr := uintptr(unsafe.Pointer(cb))218 cbPtr := uintptr(unsafe.Pointer(cb))
219 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {219 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
220- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)220+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
221+ glib.SaveHandlerMapping(handlerID, cbPtr)
222+ return handlerID
221 }223 }
222 224
223 fcb := func(clsPtr uintptr) bool {225 fcb := func(clsPtr uintptr) bool {
@@ -230,7 +232,9 @@ func (x *LinkButton) ConnectActivateLink(cb *func(LinkButton) bool) uint32 {
230 }232 }
231 cbRefPtr := purego.NewCallback(fcb)233 cbRefPtr := purego.NewCallback(fcb)
232 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)234 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
233- return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)235+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr)
236+ glib.SaveHandlerMapping(handlerID, cbPtr)
237+ return handlerID
234 }238 }
235 239
236 // Requests the user's screen reader to announce the given message.240 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtklistbox.go +63 -27
@@ -843,10 +843,12 @@ func (x *ListBox) GetPropertyShowSeparators() bool {
843 }843 }
844 844
845 // Emitted when the cursor row is activated.845 // Emitted when the cursor row is activated.
846-func (x *ListBox) ConnectActivateCursorRow(cb *func(ListBox)) uint32 {846+func (x *ListBox) ConnectActivateCursorRow(cb *func(ListBox)) uint {
847 cbPtr := uintptr(unsafe.Pointer(cb))847 cbPtr := uintptr(unsafe.Pointer(cb))
848 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {848 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
849- return gobject.SignalConnect(x.GoPointer(), "activate-cursor-row", cbRefPtr)849+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-row", cbRefPtr)
850+ glib.SaveHandlerMapping(handlerID, cbPtr)
851+ return handlerID
850 }852 }
851 853
852 fcb := func(clsPtr uintptr) {854 fcb := func(clsPtr uintptr) {
@@ -859,7 +861,9 @@ func (x *ListBox) ConnectActivateCursorRow(cb *func(ListBox)) uint32 {
859 }861 }
860 cbRefPtr := purego.NewCallback(fcb)862 cbRefPtr := purego.NewCallback(fcb)
861 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)863 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
862- return gobject.SignalConnect(x.GoPointer(), "activate-cursor-row", cbRefPtr)864+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-cursor-row", cbRefPtr)
865+ glib.SaveHandlerMapping(handlerID, cbPtr)
866+ return handlerID
863 }867 }
864 868
865 // Emitted when the user initiates a cursor movement.869 // Emitted when the user initiates a cursor movement.
@@ -873,10 +877,12 @@ func (x *ListBox) ConnectActivateCursorRow(cb *func(ListBox)) uint32 {
873 // move by individual children877 // move by individual children
874 // - &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the box878 // - &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the box
875 // - &lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt; move vertically by pages879 // - &lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt; move vertically by pages
876-func (x *ListBox) ConnectMoveCursor(cb *func(ListBox, MovementStep, int, bool, bool)) uint32 {880+func (x *ListBox) ConnectMoveCursor(cb *func(ListBox, MovementStep, int, bool, bool)) uint {
877 cbPtr := uintptr(unsafe.Pointer(cb))881 cbPtr := uintptr(unsafe.Pointer(cb))
878 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {882 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
879- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)883+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
884+ glib.SaveHandlerMapping(handlerID, cbPtr)
885+ return handlerID
880 }886 }
881 887
882 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) {888 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool, ModifyVarp bool) {
@@ -889,14 +895,18 @@ func (x *ListBox) ConnectMoveCursor(cb *func(ListBox, MovementStep, int, bool, b
889 }895 }
890 cbRefPtr := purego.NewCallback(fcb)896 cbRefPtr := purego.NewCallback(fcb)
891 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)897 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
892- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)898+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
899+ glib.SaveHandlerMapping(handlerID, cbPtr)
900+ return handlerID
893 }901 }
894 902
895 // Emitted when a row has been activated by the user.903 // Emitted when a row has been activated by the user.
896-func (x *ListBox) ConnectRowActivated(cb *func(ListBox, uintptr)) uint32 {904+func (x *ListBox) ConnectRowActivated(cb *func(ListBox, uintptr)) uint {
897 cbPtr := uintptr(unsafe.Pointer(cb))905 cbPtr := uintptr(unsafe.Pointer(cb))
898 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {906 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
899- return gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)907+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)
908+ glib.SaveHandlerMapping(handlerID, cbPtr)
909+ return handlerID
900 }910 }
901 911
902 fcb := func(clsPtr uintptr, RowVarp uintptr) {912 fcb := func(clsPtr uintptr, RowVarp uintptr) {
@@ -909,7 +919,9 @@ func (x *ListBox) ConnectRowActivated(cb *func(ListBox, uintptr)) uint32 {
909 }919 }
910 cbRefPtr := purego.NewCallback(fcb)920 cbRefPtr := purego.NewCallback(fcb)
911 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)921 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
912- return gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)922+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)
923+ glib.SaveHandlerMapping(handlerID, cbPtr)
924+ return handlerID
913 }925 }
914 926
915 // Emitted when a new row is selected, or (with a %NULL @row)927 // Emitted when a new row is selected, or (with a %NULL @row)
@@ -918,10 +930,12 @@ func (x *ListBox) ConnectRowActivated(cb *func(ListBox, uintptr)) uint32 {
918 // When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not930 // When the @box is using %GTK_SELECTION_MULTIPLE, this signal will not
919 // give you the full picture of selection changes, and you should use931 // give you the full picture of selection changes, and you should use
920 // the [signal@Gtk.ListBox::selected-rows-changed] signal instead.932 // the [signal@Gtk.ListBox::selected-rows-changed] signal instead.
921-func (x *ListBox) ConnectRowSelected(cb *func(ListBox, uintptr)) uint32 {933+func (x *ListBox) ConnectRowSelected(cb *func(ListBox, uintptr)) uint {
922 cbPtr := uintptr(unsafe.Pointer(cb))934 cbPtr := uintptr(unsafe.Pointer(cb))
923 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {935 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
924- return gobject.SignalConnect(x.GoPointer(), "row-selected", cbRefPtr)936+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-selected", cbRefPtr)
937+ glib.SaveHandlerMapping(handlerID, cbPtr)
938+ return handlerID
925 }939 }
926 940
927 fcb := func(clsPtr uintptr, RowVarp uintptr) {941 fcb := func(clsPtr uintptr, RowVarp uintptr) {
@@ -934,7 +948,9 @@ func (x *ListBox) ConnectRowSelected(cb *func(ListBox, uintptr)) uint32 {
934 }948 }
935 cbRefPtr := purego.NewCallback(fcb)949 cbRefPtr := purego.NewCallback(fcb)
936 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)950 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
937- return gobject.SignalConnect(x.GoPointer(), "row-selected", cbRefPtr)951+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-selected", cbRefPtr)
952+ glib.SaveHandlerMapping(handlerID, cbPtr)
953+ return handlerID
938 }954 }
939 955
940 // Emitted to select all children of the box, if the selection956 // Emitted to select all children of the box, if the selection
@@ -943,10 +959,12 @@ func (x *ListBox) ConnectRowSelected(cb *func(ListBox, uintptr)) uint32 {
943 // This is a [keybinding signal](class.SignalAction.html).959 // This is a [keybinding signal](class.SignalAction.html).
944 //960 //
945 // The default binding for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.961 // The default binding for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.
946-func (x *ListBox) ConnectSelectAll(cb *func(ListBox)) uint32 {962+func (x *ListBox) ConnectSelectAll(cb *func(ListBox)) uint {
947 cbPtr := uintptr(unsafe.Pointer(cb))963 cbPtr := uintptr(unsafe.Pointer(cb))
948 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {964 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
949- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)965+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
966+ glib.SaveHandlerMapping(handlerID, cbPtr)
967+ return handlerID
950 }968 }
951 969
952 fcb := func(clsPtr uintptr) {970 fcb := func(clsPtr uintptr) {
@@ -959,14 +977,18 @@ func (x *ListBox) ConnectSelectAll(cb *func(ListBox)) uint32 {
959 }977 }
960 cbRefPtr := purego.NewCallback(fcb)978 cbRefPtr := purego.NewCallback(fcb)
961 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)979 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
962- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)980+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
981+ glib.SaveHandlerMapping(handlerID, cbPtr)
982+ return handlerID
963 }983 }
964 984
965 // Emitted when the set of selected rows changes.985 // Emitted when the set of selected rows changes.
966-func (x *ListBox) ConnectSelectedRowsChanged(cb *func(ListBox)) uint32 {986+func (x *ListBox) ConnectSelectedRowsChanged(cb *func(ListBox)) uint {
967 cbPtr := uintptr(unsafe.Pointer(cb))987 cbPtr := uintptr(unsafe.Pointer(cb))
968 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {988 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
969- return gobject.SignalConnect(x.GoPointer(), "selected-rows-changed", cbRefPtr)989+ handlerID := gobject.SignalConnect(x.GoPointer(), "selected-rows-changed", cbRefPtr)
990+ glib.SaveHandlerMapping(handlerID, cbPtr)
991+ return handlerID
970 }992 }
971 993
972 fcb := func(clsPtr uintptr) {994 fcb := func(clsPtr uintptr) {
@@ -979,16 +1001,20 @@ func (x *ListBox) ConnectSelectedRowsChanged(cb *func(ListBox)) uint32 {
979 }1001 }
980 cbRefPtr := purego.NewCallback(fcb)1002 cbRefPtr := purego.NewCallback(fcb)
981 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1003 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
982- return gobject.SignalConnect(x.GoPointer(), "selected-rows-changed", cbRefPtr)1004+ handlerID := gobject.SignalConnect(x.GoPointer(), "selected-rows-changed", cbRefPtr)
1005+ glib.SaveHandlerMapping(handlerID, cbPtr)
1006+ return handlerID
983 }1007 }
984 1008
985 // Emitted when the cursor row is toggled.1009 // Emitted when the cursor row is toggled.
986 //1010 //
987 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;␣&lt;/kbd&gt;.1011 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;␣&lt;/kbd&gt;.
988-func (x *ListBox) ConnectToggleCursorRow(cb *func(ListBox)) uint32 {1012+func (x *ListBox) ConnectToggleCursorRow(cb *func(ListBox)) uint {
989 cbPtr := uintptr(unsafe.Pointer(cb))1013 cbPtr := uintptr(unsafe.Pointer(cb))
990 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1014 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
991- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)1015+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)
1016+ glib.SaveHandlerMapping(handlerID, cbPtr)
1017+ return handlerID
992 }1018 }
993 1019
994 fcb := func(clsPtr uintptr) {1020 fcb := func(clsPtr uintptr) {
@@ -1001,7 +1027,9 @@ func (x *ListBox) ConnectToggleCursorRow(cb *func(ListBox)) uint32 {
1001 }1027 }
1002 cbRefPtr := purego.NewCallback(fcb)1028 cbRefPtr := purego.NewCallback(fcb)
1003 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1029 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1004- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)1030+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)
1031+ glib.SaveHandlerMapping(handlerID, cbPtr)
1032+ return handlerID
1005 }1033 }
1006 1034
1007 // Emitted to unselect all children of the box, if the selection1035 // Emitted to unselect all children of the box, if the selection
@@ -1011,10 +1039,12 @@ func (x *ListBox) ConnectToggleCursorRow(cb *func(ListBox)) uint32 {
1011 //1039 //
1012 // The default binding for this signal is1040 // The default binding for this signal is
1013 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;Shift&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.1041 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;Shift&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt;.
1014-func (x *ListBox) ConnectUnselectAll(cb *func(ListBox)) uint32 {1042+func (x *ListBox) ConnectUnselectAll(cb *func(ListBox)) uint {
1015 cbPtr := uintptr(unsafe.Pointer(cb))1043 cbPtr := uintptr(unsafe.Pointer(cb))
1016 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1044 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1017- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)1045+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1046+ glib.SaveHandlerMapping(handlerID, cbPtr)
1047+ return handlerID
1018 }1048 }
1019 1049
1020 fcb := func(clsPtr uintptr) {1050 fcb := func(clsPtr uintptr) {
@@ -1027,7 +1057,9 @@ func (x *ListBox) ConnectUnselectAll(cb *func(ListBox)) uint32 {
1027 }1057 }
1028 cbRefPtr := purego.NewCallback(fcb)1058 cbRefPtr := purego.NewCallback(fcb)
1029 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1059 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1030- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)1060+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
1061+ glib.SaveHandlerMapping(handlerID, cbPtr)
1062+ return handlerID
1031 }1063 }
1032 1064
1033 // Requests the user's screen reader to announce the given message.1065 // Requests the user's screen reader to announce the given message.
@@ -1548,10 +1580,12 @@ func (x *ListBoxRow) GetPropertySelectable() bool {
1548 // If you want to be notified when the user activates a row (by key or not),1580 // If you want to be notified when the user activates a row (by key or not),
1549 // use the [signal@Gtk.ListBox::row-activated] signal on the row’s parent1581 // use the [signal@Gtk.ListBox::row-activated] signal on the row’s parent
1550 // `GtkListBox`.1582 // `GtkListBox`.
1551-func (x *ListBoxRow) ConnectActivate(cb *func(ListBoxRow)) uint32 {1583+func (x *ListBoxRow) ConnectActivate(cb *func(ListBoxRow)) uint {
1552 cbPtr := uintptr(unsafe.Pointer(cb))1584 cbPtr := uintptr(unsafe.Pointer(cb))
1553 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1585 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1554- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1586+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1587+ glib.SaveHandlerMapping(handlerID, cbPtr)
1588+ return handlerID
1555 }1589 }
1556 1590
1557 fcb := func(clsPtr uintptr) {1591 fcb := func(clsPtr uintptr) {
@@ -1564,7 +1598,9 @@ func (x *ListBoxRow) ConnectActivate(cb *func(ListBoxRow)) uint32 {
1564 }1598 }
1565 cbRefPtr := purego.NewCallback(fcb)1599 cbRefPtr := purego.NewCallback(fcb)
1566 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1600 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1567- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)1601+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
1602+ glib.SaveHandlerMapping(handlerID, cbPtr)
1603+ return handlerID
1568 }1604 }
1569 1605
1570 // Requests the user's screen reader to announce the given message.1606 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtklistview.go +7 -3
@@ -425,10 +425,12 @@ func (x *ListView) GetPropertySingleClickActivate() bool {
425 // This allows for a convenient way to handle activation in a listview.425 // This allows for a convenient way to handle activation in a listview.
426 // See [method@Gtk.ListItem.set_activatable] for details on how to use426 // See [method@Gtk.ListItem.set_activatable] for details on how to use
427 // this signal.427 // this signal.
428-func (x *ListView) ConnectActivate(cb *func(ListView, uint)) uint32 {428+func (x *ListView) ConnectActivate(cb *func(ListView, uint)) uint {
429 cbPtr := uintptr(unsafe.Pointer(cb))429 cbPtr := uintptr(unsafe.Pointer(cb))
430 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {430 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
431- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)431+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
432+ glib.SaveHandlerMapping(handlerID, cbPtr)
433+ return handlerID
432 }434 }
433 435
434 fcb := func(clsPtr uintptr, PositionVarp uint) {436 fcb := func(clsPtr uintptr, PositionVarp uint) {
@@ -441,7 +443,9 @@ func (x *ListView) ConnectActivate(cb *func(ListView, uint)) uint32 {
441 }443 }
442 cbRefPtr := purego.NewCallback(fcb)444 cbRefPtr := purego.NewCallback(fcb)
443 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)445 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
444- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)446+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
447+ glib.SaveHandlerMapping(handlerID, cbPtr)
448+ return handlerID
445 }449 }
446 450
447 // Requests the user's screen reader to announce the given message.451 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkmenubutton.go +7 -3
@@ -657,10 +657,12 @@ func (x *MenuButton) GetPropertyUseUnderline() bool {
657 //657 //
658 // The `::activate` signal on `GtkMenuButton` is an action signal and658 // The `::activate` signal on `GtkMenuButton` is an action signal and
659 // emitting it causes the button to pop up its menu.659 // emitting it causes the button to pop up its menu.
660-func (x *MenuButton) ConnectActivate(cb *func(MenuButton)) uint32 {660+func (x *MenuButton) ConnectActivate(cb *func(MenuButton)) uint {
661 cbPtr := uintptr(unsafe.Pointer(cb))661 cbPtr := uintptr(unsafe.Pointer(cb))
662 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {662 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
663- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)663+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
664+ glib.SaveHandlerMapping(handlerID, cbPtr)
665+ return handlerID
664 }666 }
665 667
666 fcb := func(clsPtr uintptr) {668 fcb := func(clsPtr uintptr) {
@@ -673,7 +675,9 @@ func (x *MenuButton) ConnectActivate(cb *func(MenuButton)) uint32 {
673 }675 }
674 cbRefPtr := purego.NewCallback(fcb)676 cbRefPtr := purego.NewCallback(fcb)
675 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)677 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
676- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)678+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
679+ glib.SaveHandlerMapping(handlerID, cbPtr)
680+ return handlerID
677 }681 }
678 682
679 // Requests the user's screen reader to announce the given message.683 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtknativedialog.go +7 -3
@@ -436,10 +436,12 @@ func (x *NativeDialog) GetPropertyVisible() bool {
436 //436 //
437 // If you call [method@Gtk.NativeDialog.hide] before the user437 // If you call [method@Gtk.NativeDialog.hide] before the user
438 // responds to the dialog this signal will not be emitted.438 // responds to the dialog this signal will not be emitted.
439-func (x *NativeDialog) ConnectResponse(cb *func(NativeDialog, int)) uint32 {439+func (x *NativeDialog) ConnectResponse(cb *func(NativeDialog, int)) uint {
440 cbPtr := uintptr(unsafe.Pointer(cb))440 cbPtr := uintptr(unsafe.Pointer(cb))
441 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {441 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
442- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)442+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
443+ glib.SaveHandlerMapping(handlerID, cbPtr)
444+ return handlerID
443 }445 }
444 446
445 fcb := func(clsPtr uintptr, ResponseIdVarp int) {447 fcb := func(clsPtr uintptr, ResponseIdVarp int) {
@@ -452,7 +454,9 @@ func (x *NativeDialog) ConnectResponse(cb *func(NativeDialog, int)) uint32 {
452 }454 }
453 cbRefPtr := purego.NewCallback(fcb)455 cbRefPtr := purego.NewCallback(fcb)
454 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)456 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
455- return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)457+ handlerID := gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr)
458+ glib.SaveHandlerMapping(handlerID, cbPtr)
459+ return handlerID
456 }460 }
457 461
458 func init() {462 func init() {
M v4/gtk/gtknotebook.go +70 -30
@@ -872,10 +872,12 @@ func (x *Notebook) GetPropertyShowTabs() bool {
872 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt;,872 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt;,
873 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;,873 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;,
874 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;.874 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;.
875-func (x *Notebook) ConnectChangeCurrentPage(cb *func(Notebook, int) bool) uint32 {875+func (x *Notebook) ConnectChangeCurrentPage(cb *func(Notebook, int) bool) uint {
876 cbPtr := uintptr(unsafe.Pointer(cb))876 cbPtr := uintptr(unsafe.Pointer(cb))
877 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {877 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
878- return gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)878+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)
879+ glib.SaveHandlerMapping(handlerID, cbPtr)
880+ return handlerID
879 }881 }
880 882
881 fcb := func(clsPtr uintptr, PageVarp int) bool {883 fcb := func(clsPtr uintptr, PageVarp int) bool {
@@ -888,7 +890,9 @@ func (x *Notebook) ConnectChangeCurrentPage(cb *func(Notebook, int) bool) uint32
888 }890 }
889 cbRefPtr := purego.NewCallback(fcb)891 cbRefPtr := purego.NewCallback(fcb)
890 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)892 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
891- return gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)893+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)
894+ glib.SaveHandlerMapping(handlerID, cbPtr)
895+ return handlerID
892 }896 }
893 897
894 // The ::create-window signal is emitted when a detachable898 // The ::create-window signal is emitted when a detachable
@@ -899,10 +903,12 @@ func (x *Notebook) ConnectChangeCurrentPage(cb *func(Notebook, int) bool) uint32
899 // responsible for moving/resizing the window and adding the903 // responsible for moving/resizing the window and adding the
900 // necessary properties to the notebook (e.g. the904 // necessary properties to the notebook (e.g. the
901 // `GtkNotebook`:group-name ).905 // `GtkNotebook`:group-name ).
902-func (x *Notebook) ConnectCreateWindow(cb *func(Notebook, uintptr) Notebook) uint32 {906+func (x *Notebook) ConnectCreateWindow(cb *func(Notebook, uintptr) Notebook) uint {
903 cbPtr := uintptr(unsafe.Pointer(cb))907 cbPtr := uintptr(unsafe.Pointer(cb))
904 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {908 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
905- return gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)909+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)
910+ glib.SaveHandlerMapping(handlerID, cbPtr)
911+ return handlerID
906 }912 }
907 913
908 fcb := func(clsPtr uintptr, PageVarp uintptr) uintptr {914 fcb := func(clsPtr uintptr, PageVarp uintptr) uintptr {
@@ -916,14 +922,18 @@ func (x *Notebook) ConnectCreateWindow(cb *func(Notebook, uintptr) Notebook) uin
916 }922 }
917 cbRefPtr := purego.NewCallback(fcb)923 cbRefPtr := purego.NewCallback(fcb)
918 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)924 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
919- return gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)925+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-window", cbRefPtr)
926+ glib.SaveHandlerMapping(handlerID, cbPtr)
927+ return handlerID
920 }928 }
921 929
922 // Emitted when a tab should be focused.930 // Emitted when a tab should be focused.
923-func (x *Notebook) ConnectFocusTab(cb *func(Notebook, NotebookTab) bool) uint32 {931+func (x *Notebook) ConnectFocusTab(cb *func(Notebook, NotebookTab) bool) uint {
924 cbPtr := uintptr(unsafe.Pointer(cb))932 cbPtr := uintptr(unsafe.Pointer(cb))
925 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {933 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
926- return gobject.SignalConnect(x.GoPointer(), "focus-tab", cbRefPtr)934+ handlerID := gobject.SignalConnect(x.GoPointer(), "focus-tab", cbRefPtr)
935+ glib.SaveHandlerMapping(handlerID, cbPtr)
936+ return handlerID
927 }937 }
928 938
929 fcb := func(clsPtr uintptr, TabVarp NotebookTab) bool {939 fcb := func(clsPtr uintptr, TabVarp NotebookTab) bool {
@@ -936,7 +946,9 @@ func (x *Notebook) ConnectFocusTab(cb *func(Notebook, NotebookTab) bool) uint32
936 }946 }
937 cbRefPtr := purego.NewCallback(fcb)947 cbRefPtr := purego.NewCallback(fcb)
938 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)948 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
939- return gobject.SignalConnect(x.GoPointer(), "focus-tab", cbRefPtr)949+ handlerID := gobject.SignalConnect(x.GoPointer(), "focus-tab", cbRefPtr)
950+ glib.SaveHandlerMapping(handlerID, cbPtr)
951+ return handlerID
940 }952 }
941 953
942 // Emitted when focus was moved out.954 // Emitted when focus was moved out.
@@ -946,10 +958,12 @@ func (x *Notebook) ConnectFocusTab(cb *func(Notebook, NotebookTab) bool) uint32
946 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt;,958 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt;,
947 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;→&lt;/kbd&gt;,959 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;→&lt;/kbd&gt;,
948 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;.960 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;.
949-func (x *Notebook) ConnectMoveFocusOut(cb *func(Notebook, DirectionType)) uint32 {961+func (x *Notebook) ConnectMoveFocusOut(cb *func(Notebook, DirectionType)) uint {
950 cbPtr := uintptr(unsafe.Pointer(cb))962 cbPtr := uintptr(unsafe.Pointer(cb))
951 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {963 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
952- return gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)964+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)
965+ glib.SaveHandlerMapping(handlerID, cbPtr)
966+ return handlerID
953 }967 }
954 968
955 fcb := func(clsPtr uintptr, DirectionVarp DirectionType) {969 fcb := func(clsPtr uintptr, DirectionVarp DirectionType) {
@@ -962,15 +976,19 @@ func (x *Notebook) ConnectMoveFocusOut(cb *func(Notebook, DirectionType)) uint32
962 }976 }
963 cbRefPtr := purego.NewCallback(fcb)977 cbRefPtr := purego.NewCallback(fcb)
964 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)978 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
965- return gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)979+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)
980+ glib.SaveHandlerMapping(handlerID, cbPtr)
981+ return handlerID
966 }982 }
967 983
968 // the ::page-added signal is emitted in the notebook984 // the ::page-added signal is emitted in the notebook
969 // right after a page is added to the notebook.985 // right after a page is added to the notebook.
970-func (x *Notebook) ConnectPageAdded(cb *func(Notebook, uintptr, uint)) uint32 {986+func (x *Notebook) ConnectPageAdded(cb *func(Notebook, uintptr, uint)) uint {
971 cbPtr := uintptr(unsafe.Pointer(cb))987 cbPtr := uintptr(unsafe.Pointer(cb))
972 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {988 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
973- return gobject.SignalConnect(x.GoPointer(), "page-added", cbRefPtr)989+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-added", cbRefPtr)
990+ glib.SaveHandlerMapping(handlerID, cbPtr)
991+ return handlerID
974 }992 }
975 993
976 fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {994 fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {
@@ -983,15 +1001,19 @@ func (x *Notebook) ConnectPageAdded(cb *func(Notebook, uintptr, uint)) uint32 {
983 }1001 }
984 cbRefPtr := purego.NewCallback(fcb)1002 cbRefPtr := purego.NewCallback(fcb)
985 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1003 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
986- return gobject.SignalConnect(x.GoPointer(), "page-added", cbRefPtr)1004+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-added", cbRefPtr)
1005+ glib.SaveHandlerMapping(handlerID, cbPtr)
1006+ return handlerID
987 }1007 }
988 1008
989 // the ::page-removed signal is emitted in the notebook1009 // the ::page-removed signal is emitted in the notebook
990 // right after a page is removed from the notebook.1010 // right after a page is removed from the notebook.
991-func (x *Notebook) ConnectPageRemoved(cb *func(Notebook, uintptr, uint)) uint32 {1011+func (x *Notebook) ConnectPageRemoved(cb *func(Notebook, uintptr, uint)) uint {
992 cbPtr := uintptr(unsafe.Pointer(cb))1012 cbPtr := uintptr(unsafe.Pointer(cb))
993 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1013 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
994- return gobject.SignalConnect(x.GoPointer(), "page-removed", cbRefPtr)1014+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-removed", cbRefPtr)
1015+ glib.SaveHandlerMapping(handlerID, cbPtr)
1016+ return handlerID
995 }1017 }
996 1018
997 fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {1019 fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {
@@ -1004,15 +1026,19 @@ func (x *Notebook) ConnectPageRemoved(cb *func(Notebook, uintptr, uint)) uint32
1004 }1026 }
1005 cbRefPtr := purego.NewCallback(fcb)1027 cbRefPtr := purego.NewCallback(fcb)
1006 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1028 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1007- return gobject.SignalConnect(x.GoPointer(), "page-removed", cbRefPtr)1029+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-removed", cbRefPtr)
1030+ glib.SaveHandlerMapping(handlerID, cbPtr)
1031+ return handlerID
1008 }1032 }
1009 1033
1010 // the ::page-reordered signal is emitted in the notebook1034 // the ::page-reordered signal is emitted in the notebook
1011 // right after a page has been reordered.1035 // right after a page has been reordered.
1012-func (x *Notebook) ConnectPageReordered(cb *func(Notebook, uintptr, uint)) uint32 {1036+func (x *Notebook) ConnectPageReordered(cb *func(Notebook, uintptr, uint)) uint {
1013 cbPtr := uintptr(unsafe.Pointer(cb))1037 cbPtr := uintptr(unsafe.Pointer(cb))
1014 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1038 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1015- return gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)1039+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)
1040+ glib.SaveHandlerMapping(handlerID, cbPtr)
1041+ return handlerID
1016 }1042 }
1017 1043
1018 fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {1044 fcb := func(clsPtr uintptr, ChildVarp uintptr, PageNumVarp uint) {
@@ -1025,7 +1051,9 @@ func (x *Notebook) ConnectPageReordered(cb *func(Notebook, uintptr, uint)) uint3
1025 }1051 }
1026 cbRefPtr := purego.NewCallback(fcb)1052 cbRefPtr := purego.NewCallback(fcb)
1027 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1053 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1028- return gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)1054+ handlerID := gobject.SignalConnect(x.GoPointer(), "page-reordered", cbRefPtr)
1055+ glib.SaveHandlerMapping(handlerID, cbPtr)
1056+ return handlerID
1029 }1057 }
1030 1058
1031 // Emitted when the tab should be reordered.1059 // Emitted when the tab should be reordered.
@@ -1035,10 +1063,12 @@ func (x *Notebook) ConnectPageReordered(cb *func(Notebook, uintptr, uint)) uint3
1035 // &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;,1063 // &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;,
1036 // &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;→&lt;/kbd&gt;,1064 // &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;→&lt;/kbd&gt;,
1037 // &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt; and &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;.1065 // &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt; and &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;.
1038-func (x *Notebook) ConnectReorderTab(cb *func(Notebook, DirectionType, bool) bool) uint32 {1066+func (x *Notebook) ConnectReorderTab(cb *func(Notebook, DirectionType, bool) bool) uint {
1039 cbPtr := uintptr(unsafe.Pointer(cb))1067 cbPtr := uintptr(unsafe.Pointer(cb))
1040 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1068 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1041- return gobject.SignalConnect(x.GoPointer(), "reorder-tab", cbRefPtr)1069+ handlerID := gobject.SignalConnect(x.GoPointer(), "reorder-tab", cbRefPtr)
1070+ glib.SaveHandlerMapping(handlerID, cbPtr)
1071+ return handlerID
1042 }1072 }
1043 1073
1044 fcb := func(clsPtr uintptr, DirectionVarp DirectionType, MoveToLastVarp bool) bool {1074 fcb := func(clsPtr uintptr, DirectionVarp DirectionType, MoveToLastVarp bool) bool {
@@ -1051,16 +1081,20 @@ func (x *Notebook) ConnectReorderTab(cb *func(Notebook, DirectionType, bool) boo
1051 }1081 }
1052 cbRefPtr := purego.NewCallback(fcb)1082 cbRefPtr := purego.NewCallback(fcb)
1053 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1083 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1054- return gobject.SignalConnect(x.GoPointer(), "reorder-tab", cbRefPtr)1084+ handlerID := gobject.SignalConnect(x.GoPointer(), "reorder-tab", cbRefPtr)
1085+ glib.SaveHandlerMapping(handlerID, cbPtr)
1086+ return handlerID
1055 }1087 }
1056 1088
1057 // Emitted when a page should be selected.1089 // Emitted when a page should be selected.
1058 //1090 //
1059 // The default binding for this signal is &lt;kbd&gt;␣&lt;/kbd&gt;.1091 // The default binding for this signal is &lt;kbd&gt;␣&lt;/kbd&gt;.
1060-func (x *Notebook) ConnectSelectPage(cb *func(Notebook, bool) bool) uint32 {1092+func (x *Notebook) ConnectSelectPage(cb *func(Notebook, bool) bool) uint {
1061 cbPtr := uintptr(unsafe.Pointer(cb))1093 cbPtr := uintptr(unsafe.Pointer(cb))
1062 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1094 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1063- return gobject.SignalConnect(x.GoPointer(), "select-page", cbRefPtr)1095+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-page", cbRefPtr)
1096+ glib.SaveHandlerMapping(handlerID, cbPtr)
1097+ return handlerID
1064 }1098 }
1065 1099
1066 fcb := func(clsPtr uintptr, MoveFocusVarp bool) bool {1100 fcb := func(clsPtr uintptr, MoveFocusVarp bool) bool {
@@ -1073,14 +1107,18 @@ func (x *Notebook) ConnectSelectPage(cb *func(Notebook, bool) bool) uint32 {
1073 }1107 }
1074 cbRefPtr := purego.NewCallback(fcb)1108 cbRefPtr := purego.NewCallback(fcb)
1075 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1109 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1076- return gobject.SignalConnect(x.GoPointer(), "select-page", cbRefPtr)1110+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-page", cbRefPtr)
1111+ glib.SaveHandlerMapping(handlerID, cbPtr)
1112+ return handlerID
1077 }1113 }
1078 1114
1079 // Emitted when the user or a function changes the current page.1115 // Emitted when the user or a function changes the current page.
1080-func (x *Notebook) ConnectSwitchPage(cb *func(Notebook, uintptr, uint)) uint32 {1116+func (x *Notebook) ConnectSwitchPage(cb *func(Notebook, uintptr, uint)) uint {
1081 cbPtr := uintptr(unsafe.Pointer(cb))1117 cbPtr := uintptr(unsafe.Pointer(cb))
1082 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1118 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1083- return gobject.SignalConnect(x.GoPointer(), "switch-page", cbRefPtr)1119+ handlerID := gobject.SignalConnect(x.GoPointer(), "switch-page", cbRefPtr)
1120+ glib.SaveHandlerMapping(handlerID, cbPtr)
1121+ return handlerID
1084 }1122 }
1085 1123
1086 fcb := func(clsPtr uintptr, PageVarp uintptr, PageNumVarp uint) {1124 fcb := func(clsPtr uintptr, PageVarp uintptr, PageNumVarp uint) {
@@ -1093,7 +1131,9 @@ func (x *Notebook) ConnectSwitchPage(cb *func(Notebook, uintptr, uint)) uint32 {
1093 }1131 }
1094 cbRefPtr := purego.NewCallback(fcb)1132 cbRefPtr := purego.NewCallback(fcb)
1095 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1133 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1096- return gobject.SignalConnect(x.GoPointer(), "switch-page", cbRefPtr)1134+ handlerID := gobject.SignalConnect(x.GoPointer(), "switch-page", cbRefPtr)
1135+ glib.SaveHandlerMapping(handlerID, cbPtr)
1136+ return handlerID
1097 }1137 }
1098 1138
1099 // Requests the user's screen reader to announce the given message.1139 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkoverlay.go +7 -3
@@ -199,10 +199,12 @@ func (c *Overlay) SetGoPointer(ptr uintptr) {
199 // be full-width/height). If the main child is a199 // be full-width/height). If the main child is a
200 // `GtkScrolledWindow`, the overlays are placed relative200 // `GtkScrolledWindow`, the overlays are placed relative
201 // to its contents.201 // to its contents.
202-func (x *Overlay) ConnectGetChildPosition(cb *func(Overlay, uintptr, *uintptr) bool) uint32 {202+func (x *Overlay) ConnectGetChildPosition(cb *func(Overlay, uintptr, *uintptr) bool) uint {
203 cbPtr := uintptr(unsafe.Pointer(cb))203 cbPtr := uintptr(unsafe.Pointer(cb))
204 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {204 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
205- return gobject.SignalConnect(x.GoPointer(), "get-child-position", cbRefPtr)205+ handlerID := gobject.SignalConnect(x.GoPointer(), "get-child-position", cbRefPtr)
206+ glib.SaveHandlerMapping(handlerID, cbPtr)
207+ return handlerID
206 }208 }
207 209
208 fcb := func(clsPtr uintptr, WidgetVarp uintptr, AllocationVarp *uintptr) bool {210 fcb := func(clsPtr uintptr, WidgetVarp uintptr, AllocationVarp *uintptr) bool {
@@ -215,7 +217,9 @@ func (x *Overlay) ConnectGetChildPosition(cb *func(Overlay, uintptr, *uintptr) b
215 }217 }
216 cbRefPtr := purego.NewCallback(fcb)218 cbRefPtr := purego.NewCallback(fcb)
217 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)219 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
218- return gobject.SignalConnect(x.GoPointer(), "get-child-position", cbRefPtr)220+ handlerID := gobject.SignalConnect(x.GoPointer(), "get-child-position", cbRefPtr)
221+ glib.SaveHandlerMapping(handlerID, cbPtr)
222+ return handlerID
219 }223 }
220 224
221 // Requests the user's screen reader to announce the given message.225 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkpaned.go +42 -18
@@ -472,10 +472,12 @@ func (x *Paned) GetPropertyWideHandle() bool {
472 //472 //
473 // The default binding for this signal is &lt;kbd&gt;Return&lt;/kbd&gt; or473 // The default binding for this signal is &lt;kbd&gt;Return&lt;/kbd&gt; or
474 // &lt;kbd&gt;Space&lt;/kbd&gt;.474 // &lt;kbd&gt;Space&lt;/kbd&gt;.
475-func (x *Paned) ConnectAcceptPosition(cb *func(Paned) bool) uint32 {475+func (x *Paned) ConnectAcceptPosition(cb *func(Paned) bool) uint {
476 cbPtr := uintptr(unsafe.Pointer(cb))476 cbPtr := uintptr(unsafe.Pointer(cb))
477 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {477 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
478- return gobject.SignalConnect(x.GoPointer(), "accept-position", cbRefPtr)478+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept-position", cbRefPtr)
479+ glib.SaveHandlerMapping(handlerID, cbPtr)
480+ return handlerID
479 }481 }
480 482
481 fcb := func(clsPtr uintptr) bool {483 fcb := func(clsPtr uintptr) bool {
@@ -488,7 +490,9 @@ func (x *Paned) ConnectAcceptPosition(cb *func(Paned) bool) uint32 {
488 }490 }
489 cbRefPtr := purego.NewCallback(fcb)491 cbRefPtr := purego.NewCallback(fcb)
490 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)492 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
491- return gobject.SignalConnect(x.GoPointer(), "accept-position", cbRefPtr)493+ handlerID := gobject.SignalConnect(x.GoPointer(), "accept-position", cbRefPtr)
494+ glib.SaveHandlerMapping(handlerID, cbPtr)
495+ return handlerID
492 }496 }
493 497
494 // Emitted to cancel moving the position of the handle using key498 // Emitted to cancel moving the position of the handle using key
@@ -500,10 +504,12 @@ func (x *Paned) ConnectAcceptPosition(cb *func(Paned) bool) uint32 {
500 // This is a [keybinding signal](class.SignalAction.html).504 // This is a [keybinding signal](class.SignalAction.html).
501 //505 //
502 // The default binding for this signal is &lt;kbd&gt;Escape&lt;/kbd&gt;.506 // The default binding for this signal is &lt;kbd&gt;Escape&lt;/kbd&gt;.
503-func (x *Paned) ConnectCancelPosition(cb *func(Paned) bool) uint32 {507+func (x *Paned) ConnectCancelPosition(cb *func(Paned) bool) uint {
504 cbPtr := uintptr(unsafe.Pointer(cb))508 cbPtr := uintptr(unsafe.Pointer(cb))
505 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {509 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
506- return gobject.SignalConnect(x.GoPointer(), "cancel-position", cbRefPtr)510+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel-position", cbRefPtr)
511+ glib.SaveHandlerMapping(handlerID, cbPtr)
512+ return handlerID
507 }513 }
508 514
509 fcb := func(clsPtr uintptr) bool {515 fcb := func(clsPtr uintptr) bool {
@@ -516,7 +522,9 @@ func (x *Paned) ConnectCancelPosition(cb *func(Paned) bool) uint32 {
516 }522 }
517 cbRefPtr := purego.NewCallback(fcb)523 cbRefPtr := purego.NewCallback(fcb)
518 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)524 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
519- return gobject.SignalConnect(x.GoPointer(), "cancel-position", cbRefPtr)525+ handlerID := gobject.SignalConnect(x.GoPointer(), "cancel-position", cbRefPtr)
526+ glib.SaveHandlerMapping(handlerID, cbPtr)
527+ return handlerID
520 }528 }
521 529
522 // Emitted to cycle the focus between the children of the paned.530 // Emitted to cycle the focus between the children of the paned.
@@ -524,10 +532,12 @@ func (x *Paned) ConnectCancelPosition(cb *func(Paned) bool) uint32 {
524 // This is a [keybinding signal](class.SignalAction.html).532 // This is a [keybinding signal](class.SignalAction.html).
525 //533 //
526 // The default binding is &lt;kbd&gt;F6&lt;/kbd&gt;.534 // The default binding is &lt;kbd&gt;F6&lt;/kbd&gt;.
527-func (x *Paned) ConnectCycleChildFocus(cb *func(Paned, bool) bool) uint32 {535+func (x *Paned) ConnectCycleChildFocus(cb *func(Paned, bool) bool) uint {
528 cbPtr := uintptr(unsafe.Pointer(cb))536 cbPtr := uintptr(unsafe.Pointer(cb))
529 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {537 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
530- return gobject.SignalConnect(x.GoPointer(), "cycle-child-focus", cbRefPtr)538+ handlerID := gobject.SignalConnect(x.GoPointer(), "cycle-child-focus", cbRefPtr)
539+ glib.SaveHandlerMapping(handlerID, cbPtr)
540+ return handlerID
531 }541 }
532 542
533 fcb := func(clsPtr uintptr, ReversedVarp bool) bool {543 fcb := func(clsPtr uintptr, ReversedVarp bool) bool {
@@ -540,7 +550,9 @@ func (x *Paned) ConnectCycleChildFocus(cb *func(Paned, bool) bool) uint32 {
540 }550 }
541 cbRefPtr := purego.NewCallback(fcb)551 cbRefPtr := purego.NewCallback(fcb)
542 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)552 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
543- return gobject.SignalConnect(x.GoPointer(), "cycle-child-focus", cbRefPtr)553+ handlerID := gobject.SignalConnect(x.GoPointer(), "cycle-child-focus", cbRefPtr)
554+ glib.SaveHandlerMapping(handlerID, cbPtr)
555+ return handlerID
544 }556 }
545 557
546 // Emitted to cycle whether the paned should grab focus to allow558 // Emitted to cycle whether the paned should grab focus to allow
@@ -549,10 +561,12 @@ func (x *Paned) ConnectCycleChildFocus(cb *func(Paned, bool) bool) uint32 {
549 // This is a [keybinding signal](class.SignalAction.html).561 // This is a [keybinding signal](class.SignalAction.html).
550 //562 //
551 // The default binding for this signal is &lt;kbd&gt;F8&lt;/kbd&gt;.563 // The default binding for this signal is &lt;kbd&gt;F8&lt;/kbd&gt;.
552-func (x *Paned) ConnectCycleHandleFocus(cb *func(Paned, bool) bool) uint32 {564+func (x *Paned) ConnectCycleHandleFocus(cb *func(Paned, bool) bool) uint {
553 cbPtr := uintptr(unsafe.Pointer(cb))565 cbPtr := uintptr(unsafe.Pointer(cb))
554 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {566 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
555- return gobject.SignalConnect(x.GoPointer(), "cycle-handle-focus", cbRefPtr)567+ handlerID := gobject.SignalConnect(x.GoPointer(), "cycle-handle-focus", cbRefPtr)
568+ glib.SaveHandlerMapping(handlerID, cbPtr)
569+ return handlerID
556 }570 }
557 571
558 fcb := func(clsPtr uintptr, ReversedVarp bool) bool {572 fcb := func(clsPtr uintptr, ReversedVarp bool) bool {
@@ -565,7 +579,9 @@ func (x *Paned) ConnectCycleHandleFocus(cb *func(Paned, bool) bool) uint32 {
565 }579 }
566 cbRefPtr := purego.NewCallback(fcb)580 cbRefPtr := purego.NewCallback(fcb)
567 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)581 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
568- return gobject.SignalConnect(x.GoPointer(), "cycle-handle-focus", cbRefPtr)582+ handlerID := gobject.SignalConnect(x.GoPointer(), "cycle-handle-focus", cbRefPtr)
583+ glib.SaveHandlerMapping(handlerID, cbPtr)
584+ return handlerID
569 }585 }
570 586
571 // Emitted to move the handle with key bindings.587 // Emitted to move the handle with key bindings.
@@ -578,10 +594,12 @@ func (x *Paned) ConnectCycleHandleFocus(cb *func(Paned, bool) bool) uint32 {
578 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt;, &lt;kbd&gt;↑&lt;/kbd&gt;,594 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt;, &lt;kbd&gt;↑&lt;/kbd&gt;,
579 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;, &lt;kbd&gt;↓&lt;/kbd&gt;,595 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;, &lt;kbd&gt;↓&lt;/kbd&gt;,
580 // &lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt;, &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;End&lt;/kbd&gt;.596 // &lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt;, &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;End&lt;/kbd&gt;.
581-func (x *Paned) ConnectMoveHandle(cb *func(Paned, ScrollType) bool) uint32 {597+func (x *Paned) ConnectMoveHandle(cb *func(Paned, ScrollType) bool) uint {
582 cbPtr := uintptr(unsafe.Pointer(cb))598 cbPtr := uintptr(unsafe.Pointer(cb))
583 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {599 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
584- return gobject.SignalConnect(x.GoPointer(), "move-handle", cbRefPtr)600+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-handle", cbRefPtr)
601+ glib.SaveHandlerMapping(handlerID, cbPtr)
602+ return handlerID
585 }603 }
586 604
587 fcb := func(clsPtr uintptr, ScrollTypeVarp ScrollType) bool {605 fcb := func(clsPtr uintptr, ScrollTypeVarp ScrollType) bool {
@@ -594,7 +612,9 @@ func (x *Paned) ConnectMoveHandle(cb *func(Paned, ScrollType) bool) uint32 {
594 }612 }
595 cbRefPtr := purego.NewCallback(fcb)613 cbRefPtr := purego.NewCallback(fcb)
596 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)614 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
597- return gobject.SignalConnect(x.GoPointer(), "move-handle", cbRefPtr)615+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-handle", cbRefPtr)
616+ glib.SaveHandlerMapping(handlerID, cbPtr)
617+ return handlerID
598 }618 }
599 619
600 // Emitted to accept the current position of the handle and then620 // Emitted to accept the current position of the handle and then
@@ -603,10 +623,12 @@ func (x *Paned) ConnectMoveHandle(cb *func(Paned, ScrollType) bool) uint32 {
603 // This is a [keybinding signal](class.SignalAction.html).623 // This is a [keybinding signal](class.SignalAction.html).
604 //624 //
605 // The default binding is &lt;kbd&gt;Tab&lt;/kbd&gt;.625 // The default binding is &lt;kbd&gt;Tab&lt;/kbd&gt;.
606-func (x *Paned) ConnectToggleHandleFocus(cb *func(Paned) bool) uint32 {626+func (x *Paned) ConnectToggleHandleFocus(cb *func(Paned) bool) uint {
607 cbPtr := uintptr(unsafe.Pointer(cb))627 cbPtr := uintptr(unsafe.Pointer(cb))
608 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {628 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
609- return gobject.SignalConnect(x.GoPointer(), "toggle-handle-focus", cbRefPtr)629+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-handle-focus", cbRefPtr)
630+ glib.SaveHandlerMapping(handlerID, cbPtr)
631+ return handlerID
610 }632 }
611 633
612 fcb := func(clsPtr uintptr) bool {634 fcb := func(clsPtr uintptr) bool {
@@ -619,7 +641,9 @@ func (x *Paned) ConnectToggleHandleFocus(cb *func(Paned) bool) uint32 {
619 }641 }
620 cbRefPtr := purego.NewCallback(fcb)642 cbRefPtr := purego.NewCallback(fcb)
621 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)643 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
622- return gobject.SignalConnect(x.GoPointer(), "toggle-handle-focus", cbRefPtr)644+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-handle-focus", cbRefPtr)
645+ glib.SaveHandlerMapping(handlerID, cbPtr)
646+ return handlerID
623 }647 }
624 648
625 // Requests the user's screen reader to announce the given message.649 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkpasswordentry.go +7 -3
@@ -210,10 +210,12 @@ func (x *PasswordEntry) GetPropertyShowPeekIcon() bool {
210 // Emitted when the entry is activated.210 // Emitted when the entry is activated.
211 //211 //
212 // The keybindings for this signal are all forms of the Enter key.212 // The keybindings for this signal are all forms of the Enter key.
213-func (x *PasswordEntry) ConnectActivate(cb *func(PasswordEntry)) uint32 {213+func (x *PasswordEntry) ConnectActivate(cb *func(PasswordEntry)) uint {
214 cbPtr := uintptr(unsafe.Pointer(cb))214 cbPtr := uintptr(unsafe.Pointer(cb))
215 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {215 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
216- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)216+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
217+ glib.SaveHandlerMapping(handlerID, cbPtr)
218+ return handlerID
217 }219 }
218 220
219 fcb := func(clsPtr uintptr) {221 fcb := func(clsPtr uintptr) {
@@ -226,7 +228,9 @@ func (x *PasswordEntry) ConnectActivate(cb *func(PasswordEntry)) uint32 {
226 }228 }
227 cbRefPtr := purego.NewCallback(fcb)229 cbRefPtr := purego.NewCallback(fcb)
228 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)230 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
229- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)231+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
232+ glib.SaveHandlerMapping(handlerID, cbPtr)
233+ return handlerID
230 }234 }
231 235
232 // Requests the user's screen reader to announce the given message.236 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkpopover.go +14 -6
@@ -557,10 +557,12 @@ func (x *Popover) GetPropertyPointingTo() uintptr {
557 // This is a [keybinding signal](class.SignalAction.html).557 // This is a [keybinding signal](class.SignalAction.html).
558 //558 //
559 // The default binding for this signal is &lt;kbd&gt;Enter&lt;/kbd&gt;.559 // The default binding for this signal is &lt;kbd&gt;Enter&lt;/kbd&gt;.
560-func (x *Popover) ConnectActivateDefault(cb *func(Popover)) uint32 {560+func (x *Popover) ConnectActivateDefault(cb *func(Popover)) uint {
561 cbPtr := uintptr(unsafe.Pointer(cb))561 cbPtr := uintptr(unsafe.Pointer(cb))
562 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {562 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
563- return gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)563+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
564+ glib.SaveHandlerMapping(handlerID, cbPtr)
565+ return handlerID
564 }566 }
565 567
566 fcb := func(clsPtr uintptr) {568 fcb := func(clsPtr uintptr) {
@@ -573,14 +575,18 @@ func (x *Popover) ConnectActivateDefault(cb *func(Popover)) uint32 {
573 }575 }
574 cbRefPtr := purego.NewCallback(fcb)576 cbRefPtr := purego.NewCallback(fcb)
575 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)577 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
576- return gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)578+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
579+ glib.SaveHandlerMapping(handlerID, cbPtr)
580+ return handlerID
577 }581 }
578 582
579 // Emitted when the popover is closed.583 // Emitted when the popover is closed.
580-func (x *Popover) ConnectClosed(cb *func(Popover)) uint32 {584+func (x *Popover) ConnectClosed(cb *func(Popover)) uint {
581 cbPtr := uintptr(unsafe.Pointer(cb))585 cbPtr := uintptr(unsafe.Pointer(cb))
582 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {586 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
583- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)587+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
588+ glib.SaveHandlerMapping(handlerID, cbPtr)
589+ return handlerID
584 }590 }
585 591
586 fcb := func(clsPtr uintptr) {592 fcb := func(clsPtr uintptr) {
@@ -593,7 +599,9 @@ func (x *Popover) ConnectClosed(cb *func(Popover)) uint32 {
593 }599 }
594 cbRefPtr := purego.NewCallback(fcb)600 cbRefPtr := purego.NewCallback(fcb)
595 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)601 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
596- return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)602+ handlerID := gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr)
603+ glib.SaveHandlerMapping(handlerID, cbPtr)
604+ return handlerID
597 }605 }
598 606
599 // Requests the user's screen reader to announce the given message.607 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkprinter.go +7 -3
@@ -549,10 +549,12 @@ func (x *Printer) GetPropertyStateMessage() string {
549 //549 //
550 // The @success parameter indicates if the information was550 // The @success parameter indicates if the information was
551 // actually obtained.551 // actually obtained.
552-func (x *Printer) ConnectDetailsAcquired(cb *func(Printer, bool)) uint32 {552+func (x *Printer) ConnectDetailsAcquired(cb *func(Printer, bool)) uint {
553 cbPtr := uintptr(unsafe.Pointer(cb))553 cbPtr := uintptr(unsafe.Pointer(cb))
554 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {554 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
555- return gobject.SignalConnect(x.GoPointer(), "details-acquired", cbRefPtr)555+ handlerID := gobject.SignalConnect(x.GoPointer(), "details-acquired", cbRefPtr)
556+ glib.SaveHandlerMapping(handlerID, cbPtr)
557+ return handlerID
556 }558 }
557 559
558 fcb := func(clsPtr uintptr, SuccessVarp bool) {560 fcb := func(clsPtr uintptr, SuccessVarp bool) {
@@ -565,7 +567,9 @@ func (x *Printer) ConnectDetailsAcquired(cb *func(Printer, bool)) uint32 {
565 }567 }
566 cbRefPtr := purego.NewCallback(fcb)568 cbRefPtr := purego.NewCallback(fcb)
567 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)569 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
568- return gobject.SignalConnect(x.GoPointer(), "details-acquired", cbRefPtr)570+ handlerID := gobject.SignalConnect(x.GoPointer(), "details-acquired", cbRefPtr)
571+ glib.SaveHandlerMapping(handlerID, cbPtr)
572+ return handlerID
569 }573 }
570 574
571 func init() {575 func init() {
M v4/gtk/gtkprintjob.go +7 -3
@@ -485,10 +485,12 @@ func (x *PrintJob) GetPropertyTrackPrintStatus() bool {
485 //485 //
486 // The signal handler can use [method@Gtk.PrintJob.get_status]486 // The signal handler can use [method@Gtk.PrintJob.get_status]
487 // to obtain the new status.487 // to obtain the new status.
488-func (x *PrintJob) ConnectStatusChanged(cb *func(PrintJob)) uint32 {488+func (x *PrintJob) ConnectStatusChanged(cb *func(PrintJob)) uint {
489 cbPtr := uintptr(unsafe.Pointer(cb))489 cbPtr := uintptr(unsafe.Pointer(cb))
490 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {490 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
491- return gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)491+ handlerID := gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)
492+ glib.SaveHandlerMapping(handlerID, cbPtr)
493+ return handlerID
492 }494 }
493 495
494 fcb := func(clsPtr uintptr) {496 fcb := func(clsPtr uintptr) {
@@ -501,7 +503,9 @@ func (x *PrintJob) ConnectStatusChanged(cb *func(PrintJob)) uint32 {
501 }503 }
502 cbRefPtr := purego.NewCallback(fcb)504 cbRefPtr := purego.NewCallback(fcb)
503 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)505 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
504- return gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)506+ handlerID := gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)
507+ glib.SaveHandlerMapping(handlerID, cbPtr)
508+ return handlerID
505 }509 }
506 510
507 func init() {511 func init() {
M v4/gtk/gtkprintoperation.go +77 -33
@@ -1501,10 +1501,12 @@ func (x *PrintOperation) GetPropertyUseFullPage() bool {
1501 // [class@Gtk.PrintContext] and paginate the document accordingly,1501 // [class@Gtk.PrintContext] and paginate the document accordingly,
1502 // and then set the number of pages with1502 // and then set the number of pages with
1503 // [method@Gtk.PrintOperation.set_n_pages].1503 // [method@Gtk.PrintOperation.set_n_pages].
1504-func (x *PrintOperation) ConnectBeginPrint(cb *func(PrintOperation, uintptr)) uint32 {1504+func (x *PrintOperation) ConnectBeginPrint(cb *func(PrintOperation, uintptr)) uint {
1505 cbPtr := uintptr(unsafe.Pointer(cb))1505 cbPtr := uintptr(unsafe.Pointer(cb))
1506 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1506 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1507- return gobject.SignalConnect(x.GoPointer(), "begin-print", cbRefPtr)1507+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin-print", cbRefPtr)
1508+ glib.SaveHandlerMapping(handlerID, cbPtr)
1509+ return handlerID
1508 }1510 }
1509 1511
1510 fcb := func(clsPtr uintptr, ContextVarp uintptr) {1512 fcb := func(clsPtr uintptr, ContextVarp uintptr) {
@@ -1517,7 +1519,9 @@ func (x *PrintOperation) ConnectBeginPrint(cb *func(PrintOperation, uintptr)) ui
1517 }1519 }
1518 cbRefPtr := purego.NewCallback(fcb)1520 cbRefPtr := purego.NewCallback(fcb)
1519 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1521 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1520- return gobject.SignalConnect(x.GoPointer(), "begin-print", cbRefPtr)1522+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin-print", cbRefPtr)
1523+ glib.SaveHandlerMapping(handlerID, cbPtr)
1524+ return handlerID
1521 }1525 }
1522 1526
1523 // Emitted when displaying the print dialog.1527 // Emitted when displaying the print dialog.
@@ -1531,10 +1535,12 @@ func (x *PrintOperation) ConnectBeginPrint(cb *func(PrintOperation, uintptr)) ui
1531 // to stay around until the [signal@Gtk.PrintOperation::custom-widget-apply]1535 // to stay around until the [signal@Gtk.PrintOperation::custom-widget-apply]
1532 // signal is emitted on the operation. Then you can read out any1536 // signal is emitted on the operation. Then you can read out any
1533 // information you need from the widgets.1537 // information you need from the widgets.
1534-func (x *PrintOperation) ConnectCreateCustomWidget(cb *func(PrintOperation) gobject.Object) uint32 {1538+func (x *PrintOperation) ConnectCreateCustomWidget(cb *func(PrintOperation) gobject.Object) uint {
1535 cbPtr := uintptr(unsafe.Pointer(cb))1539 cbPtr := uintptr(unsafe.Pointer(cb))
1536 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1540 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1537- return gobject.SignalConnect(x.GoPointer(), "create-custom-widget", cbRefPtr)1541+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-custom-widget", cbRefPtr)
1542+ glib.SaveHandlerMapping(handlerID, cbPtr)
1543+ return handlerID
1538 }1544 }
1539 1545
1540 fcb := func(clsPtr uintptr) uintptr {1546 fcb := func(clsPtr uintptr) uintptr {
@@ -1548,7 +1554,9 @@ func (x *PrintOperation) ConnectCreateCustomWidget(cb *func(PrintOperation) gobj
1548 }1554 }
1549 cbRefPtr := purego.NewCallback(fcb)1555 cbRefPtr := purego.NewCallback(fcb)
1550 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1556 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1551- return gobject.SignalConnect(x.GoPointer(), "create-custom-widget", cbRefPtr)1557+ handlerID := gobject.SignalConnect(x.GoPointer(), "create-custom-widget", cbRefPtr)
1558+ glib.SaveHandlerMapping(handlerID, cbPtr)
1559+ return handlerID
1552 }1560 }
1553 1561
1554 // Emitted right before ::begin-print if you added1562 // Emitted right before ::begin-print if you added
@@ -1557,10 +1565,12 @@ func (x *PrintOperation) ConnectCreateCustomWidget(cb *func(PrintOperation) gobj
1557 // When you get this signal you should read the information from the1565 // When you get this signal you should read the information from the
1558 // custom widgets, as the widgets are not guaranteed to be around at a1566 // custom widgets, as the widgets are not guaranteed to be around at a
1559 // later time.1567 // later time.
1560-func (x *PrintOperation) ConnectCustomWidgetApply(cb *func(PrintOperation, uintptr)) uint32 {1568+func (x *PrintOperation) ConnectCustomWidgetApply(cb *func(PrintOperation, uintptr)) uint {
1561 cbPtr := uintptr(unsafe.Pointer(cb))1569 cbPtr := uintptr(unsafe.Pointer(cb))
1562 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1570 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1563- return gobject.SignalConnect(x.GoPointer(), "custom-widget-apply", cbRefPtr)1571+ handlerID := gobject.SignalConnect(x.GoPointer(), "custom-widget-apply", cbRefPtr)
1572+ glib.SaveHandlerMapping(handlerID, cbPtr)
1573+ return handlerID
1564 }1574 }
1565 1575
1566 fcb := func(clsPtr uintptr, WidgetVarp uintptr) {1576 fcb := func(clsPtr uintptr, WidgetVarp uintptr) {
@@ -1573,7 +1583,9 @@ func (x *PrintOperation) ConnectCustomWidgetApply(cb *func(PrintOperation, uintp
1573 }1583 }
1574 cbRefPtr := purego.NewCallback(fcb)1584 cbRefPtr := purego.NewCallback(fcb)
1575 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1585 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1576- return gobject.SignalConnect(x.GoPointer(), "custom-widget-apply", cbRefPtr)1586+ handlerID := gobject.SignalConnect(x.GoPointer(), "custom-widget-apply", cbRefPtr)
1587+ glib.SaveHandlerMapping(handlerID, cbPtr)
1588+ return handlerID
1577 }1589 }
1578 1590
1579 // Emitted when the print operation run has finished doing1591 // Emitted when the print operation run has finished doing
@@ -1586,10 +1598,12 @@ func (x *PrintOperation) ConnectCustomWidgetApply(cb *func(PrintOperation, uintp
1586 // If you enabled print status tracking then1598 // If you enabled print status tracking then
1587 // [method@Gtk.PrintOperation.is_finished] may still return %FALSE1599 // [method@Gtk.PrintOperation.is_finished] may still return %FALSE
1588 // after the ::done signal was emitted.1600 // after the ::done signal was emitted.
1589-func (x *PrintOperation) ConnectDone(cb *func(PrintOperation, PrintOperationResult)) uint32 {1601+func (x *PrintOperation) ConnectDone(cb *func(PrintOperation, PrintOperationResult)) uint {
1590 cbPtr := uintptr(unsafe.Pointer(cb))1602 cbPtr := uintptr(unsafe.Pointer(cb))
1591 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1603 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1592- return gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)1604+ handlerID := gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)
1605+ glib.SaveHandlerMapping(handlerID, cbPtr)
1606+ return handlerID
1593 }1607 }
1594 1608
1595 fcb := func(clsPtr uintptr, ResultVarp PrintOperationResult) {1609 fcb := func(clsPtr uintptr, ResultVarp PrintOperationResult) {
@@ -1602,7 +1616,9 @@ func (x *PrintOperation) ConnectDone(cb *func(PrintOperation, PrintOperationResu
1602 }1616 }
1603 cbRefPtr := purego.NewCallback(fcb)1617 cbRefPtr := purego.NewCallback(fcb)
1604 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1618 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1605- return gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)1619+ handlerID := gobject.SignalConnect(x.GoPointer(), "done", cbRefPtr)
1620+ glib.SaveHandlerMapping(handlerID, cbPtr)
1621+ return handlerID
1606 }1622 }
1607 1623
1608 // Emitted for every page that is printed.1624 // Emitted for every page that is printed.
@@ -1659,10 +1675,12 @@ func (x *PrintOperation) ConnectDone(cb *func(PrintOperation, PrintOperationResu
1659 // [method@Gtk.PrintOperation.set_unit] before starting the print1675 // [method@Gtk.PrintOperation.set_unit] before starting the print
1660 // operation to set up the transformation of the cairo context1676 // operation to set up the transformation of the cairo context
1661 // according to your needs.1677 // according to your needs.
1662-func (x *PrintOperation) ConnectDrawPage(cb *func(PrintOperation, uintptr, int)) uint32 {1678+func (x *PrintOperation) ConnectDrawPage(cb *func(PrintOperation, uintptr, int)) uint {
1663 cbPtr := uintptr(unsafe.Pointer(cb))1679 cbPtr := uintptr(unsafe.Pointer(cb))
1664 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1680 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1665- return gobject.SignalConnect(x.GoPointer(), "draw-page", cbRefPtr)1681+ handlerID := gobject.SignalConnect(x.GoPointer(), "draw-page", cbRefPtr)
1682+ glib.SaveHandlerMapping(handlerID, cbPtr)
1683+ return handlerID
1666 }1684 }
1667 1685
1668 fcb := func(clsPtr uintptr, ContextVarp uintptr, PageNrVarp int) {1686 fcb := func(clsPtr uintptr, ContextVarp uintptr, PageNrVarp int) {
@@ -1675,17 +1693,21 @@ func (x *PrintOperation) ConnectDrawPage(cb *func(PrintOperation, uintptr, int))
1675 }1693 }
1676 cbRefPtr := purego.NewCallback(fcb)1694 cbRefPtr := purego.NewCallback(fcb)
1677 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1695 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1678- return gobject.SignalConnect(x.GoPointer(), "draw-page", cbRefPtr)1696+ handlerID := gobject.SignalConnect(x.GoPointer(), "draw-page", cbRefPtr)
1697+ glib.SaveHandlerMapping(handlerID, cbPtr)
1698+ return handlerID
1679 }1699 }
1680 1700
1681 // Emitted after all pages have been rendered.1701 // Emitted after all pages have been rendered.
1682 //1702 //
1683 // A handler for this signal can clean up any resources that have1703 // A handler for this signal can clean up any resources that have
1684 // been allocated in the [signal@Gtk.PrintOperation::begin-print] handler.1704 // been allocated in the [signal@Gtk.PrintOperation::begin-print] handler.
1685-func (x *PrintOperation) ConnectEndPrint(cb *func(PrintOperation, uintptr)) uint32 {1705+func (x *PrintOperation) ConnectEndPrint(cb *func(PrintOperation, uintptr)) uint {
1686 cbPtr := uintptr(unsafe.Pointer(cb))1706 cbPtr := uintptr(unsafe.Pointer(cb))
1687 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1707 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1688- return gobject.SignalConnect(x.GoPointer(), "end-print", cbRefPtr)1708+ handlerID := gobject.SignalConnect(x.GoPointer(), "end-print", cbRefPtr)
1709+ glib.SaveHandlerMapping(handlerID, cbPtr)
1710+ return handlerID
1689 }1711 }
1690 1712
1691 fcb := func(clsPtr uintptr, ContextVarp uintptr) {1713 fcb := func(clsPtr uintptr, ContextVarp uintptr) {
@@ -1698,7 +1720,9 @@ func (x *PrintOperation) ConnectEndPrint(cb *func(PrintOperation, uintptr)) uint
1698 }1720 }
1699 cbRefPtr := purego.NewCallback(fcb)1721 cbRefPtr := purego.NewCallback(fcb)
1700 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1722 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1701- return gobject.SignalConnect(x.GoPointer(), "end-print", cbRefPtr)1723+ handlerID := gobject.SignalConnect(x.GoPointer(), "end-print", cbRefPtr)
1724+ glib.SaveHandlerMapping(handlerID, cbPtr)
1725+ return handlerID
1702 }1726 }
1703 1727
1704 // Emitted after the ::begin-print signal, but before the actual rendering1728 // Emitted after the ::begin-print signal, but before the actual rendering
@@ -1715,10 +1739,12 @@ func (x *PrintOperation) ConnectEndPrint(cb *func(PrintOperation, uintptr)) uint
1715 // If you don't need to do pagination in chunks, you can simply do1739 // If you don't need to do pagination in chunks, you can simply do
1716 // it all in the ::begin-print handler, and set the number of pages1740 // it all in the ::begin-print handler, and set the number of pages
1717 // from there.1741 // from there.
1718-func (x *PrintOperation) ConnectPaginate(cb *func(PrintOperation, uintptr) bool) uint32 {1742+func (x *PrintOperation) ConnectPaginate(cb *func(PrintOperation, uintptr) bool) uint {
1719 cbPtr := uintptr(unsafe.Pointer(cb))1743 cbPtr := uintptr(unsafe.Pointer(cb))
1720 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1744 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1721- return gobject.SignalConnect(x.GoPointer(), "paginate", cbRefPtr)1745+ handlerID := gobject.SignalConnect(x.GoPointer(), "paginate", cbRefPtr)
1746+ glib.SaveHandlerMapping(handlerID, cbPtr)
1747+ return handlerID
1722 }1748 }
1723 1749
1724 fcb := func(clsPtr uintptr, ContextVarp uintptr) bool {1750 fcb := func(clsPtr uintptr, ContextVarp uintptr) bool {
@@ -1731,7 +1757,9 @@ func (x *PrintOperation) ConnectPaginate(cb *func(PrintOperation, uintptr) bool)
1731 }1757 }
1732 cbRefPtr := purego.NewCallback(fcb)1758 cbRefPtr := purego.NewCallback(fcb)
1733 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1759 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1734- return gobject.SignalConnect(x.GoPointer(), "paginate", cbRefPtr)1760+ handlerID := gobject.SignalConnect(x.GoPointer(), "paginate", cbRefPtr)
1761+ glib.SaveHandlerMapping(handlerID, cbPtr)
1762+ return handlerID
1735 }1763 }
1736 1764
1737 // Gets emitted when a preview is requested from the native dialog.1765 // Gets emitted when a preview is requested from the native dialog.
@@ -1751,10 +1779,12 @@ func (x *PrintOperation) ConnectPaginate(cb *func(PrintOperation, uintptr) bool)
1751 // are selected for print and render them. The preview must be1779 // are selected for print and render them. The preview must be
1752 // finished by calling [method@Gtk.PrintOperationPreview.end_preview]1780 // finished by calling [method@Gtk.PrintOperationPreview.end_preview]
1753 // (typically in response to the user clicking a close button).1781 // (typically in response to the user clicking a close button).
1754-func (x *PrintOperation) ConnectPreview(cb *func(PrintOperation, uintptr, uintptr, uintptr) bool) uint32 {1782+func (x *PrintOperation) ConnectPreview(cb *func(PrintOperation, uintptr, uintptr, uintptr) bool) uint {
1755 cbPtr := uintptr(unsafe.Pointer(cb))1783 cbPtr := uintptr(unsafe.Pointer(cb))
1756 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1784 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1757- return gobject.SignalConnect(x.GoPointer(), "preview", cbRefPtr)1785+ handlerID := gobject.SignalConnect(x.GoPointer(), "preview", cbRefPtr)
1786+ glib.SaveHandlerMapping(handlerID, cbPtr)
1787+ return handlerID
1758 }1788 }
1759 1789
1760 fcb := func(clsPtr uintptr, PreviewVarp uintptr, ContextVarp uintptr, ParentVarp uintptr) bool {1790 fcb := func(clsPtr uintptr, PreviewVarp uintptr, ContextVarp uintptr, ParentVarp uintptr) bool {
@@ -1767,7 +1797,9 @@ func (x *PrintOperation) ConnectPreview(cb *func(PrintOperation, uintptr, uintpt
1767 }1797 }
1768 cbRefPtr := purego.NewCallback(fcb)1798 cbRefPtr := purego.NewCallback(fcb)
1769 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1799 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1770- return gobject.SignalConnect(x.GoPointer(), "preview", cbRefPtr)1800+ handlerID := gobject.SignalConnect(x.GoPointer(), "preview", cbRefPtr)
1801+ glib.SaveHandlerMapping(handlerID, cbPtr)
1802+ return handlerID
1771 }1803 }
1772 1804
1773 // Emitted once for every page that is printed.1805 // Emitted once for every page that is printed.
@@ -1775,10 +1807,12 @@ func (x *PrintOperation) ConnectPreview(cb *func(PrintOperation, uintptr, uintpt
1775 // This gives the application a chance to modify the page setup.1807 // This gives the application a chance to modify the page setup.
1776 // Any changes done to @setup will be in force only for printing1808 // Any changes done to @setup will be in force only for printing
1777 // this page.1809 // this page.
1778-func (x *PrintOperation) ConnectRequestPageSetup(cb *func(PrintOperation, uintptr, int, uintptr)) uint32 {1810+func (x *PrintOperation) ConnectRequestPageSetup(cb *func(PrintOperation, uintptr, int, uintptr)) uint {
1779 cbPtr := uintptr(unsafe.Pointer(cb))1811 cbPtr := uintptr(unsafe.Pointer(cb))
1780 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1812 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1781- return gobject.SignalConnect(x.GoPointer(), "request-page-setup", cbRefPtr)1813+ handlerID := gobject.SignalConnect(x.GoPointer(), "request-page-setup", cbRefPtr)
1814+ glib.SaveHandlerMapping(handlerID, cbPtr)
1815+ return handlerID
1782 }1816 }
1783 1817
1784 fcb := func(clsPtr uintptr, ContextVarp uintptr, PageNrVarp int, SetupVarp uintptr) {1818 fcb := func(clsPtr uintptr, ContextVarp uintptr, PageNrVarp int, SetupVarp uintptr) {
@@ -1791,7 +1825,9 @@ func (x *PrintOperation) ConnectRequestPageSetup(cb *func(PrintOperation, uintpt
1791 }1825 }
1792 cbRefPtr := purego.NewCallback(fcb)1826 cbRefPtr := purego.NewCallback(fcb)
1793 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1827 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1794- return gobject.SignalConnect(x.GoPointer(), "request-page-setup", cbRefPtr)1828+ handlerID := gobject.SignalConnect(x.GoPointer(), "request-page-setup", cbRefPtr)
1829+ glib.SaveHandlerMapping(handlerID, cbPtr)
1830+ return handlerID
1795 }1831 }
1796 1832
1797 // Emitted at between the various phases of the print operation.1833 // Emitted at between the various phases of the print operation.
@@ -1799,10 +1835,12 @@ func (x *PrintOperation) ConnectRequestPageSetup(cb *func(PrintOperation, uintpt
1799 // See [enum@Gtk.PrintStatus] for the phases that are being discriminated.1835 // See [enum@Gtk.PrintStatus] for the phases that are being discriminated.
1800 // Use [method@Gtk.PrintOperation.get_status] to find out the current1836 // Use [method@Gtk.PrintOperation.get_status] to find out the current
1801 // status.1837 // status.
1802-func (x *PrintOperation) ConnectStatusChanged(cb *func(PrintOperation)) uint32 {1838+func (x *PrintOperation) ConnectStatusChanged(cb *func(PrintOperation)) uint {
1803 cbPtr := uintptr(unsafe.Pointer(cb))1839 cbPtr := uintptr(unsafe.Pointer(cb))
1804 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1840 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1805- return gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)1841+ handlerID := gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)
1842+ glib.SaveHandlerMapping(handlerID, cbPtr)
1843+ return handlerID
1806 }1844 }
1807 1845
1808 fcb := func(clsPtr uintptr) {1846 fcb := func(clsPtr uintptr) {
@@ -1815,17 +1853,21 @@ func (x *PrintOperation) ConnectStatusChanged(cb *func(PrintOperation)) uint32 {
1815 }1853 }
1816 cbRefPtr := purego.NewCallback(fcb)1854 cbRefPtr := purego.NewCallback(fcb)
1817 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1855 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1818- return gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)1856+ handlerID := gobject.SignalConnect(x.GoPointer(), "status-changed", cbRefPtr)
1857+ glib.SaveHandlerMapping(handlerID, cbPtr)
1858+ return handlerID
1819 }1859 }
1820 1860
1821 // Emitted after change of selected printer.1861 // Emitted after change of selected printer.
1822 //1862 //
1823 // The actual page setup and print settings are passed to the custom1863 // The actual page setup and print settings are passed to the custom
1824 // widget, which can actualize itself according to this change.1864 // widget, which can actualize itself according to this change.
1825-func (x *PrintOperation) ConnectUpdateCustomWidget(cb *func(PrintOperation, uintptr, uintptr, uintptr)) uint32 {1865+func (x *PrintOperation) ConnectUpdateCustomWidget(cb *func(PrintOperation, uintptr, uintptr, uintptr)) uint {
1826 cbPtr := uintptr(unsafe.Pointer(cb))1866 cbPtr := uintptr(unsafe.Pointer(cb))
1827 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1867 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1828- return gobject.SignalConnect(x.GoPointer(), "update-custom-widget", cbRefPtr)1868+ handlerID := gobject.SignalConnect(x.GoPointer(), "update-custom-widget", cbRefPtr)
1869+ glib.SaveHandlerMapping(handlerID, cbPtr)
1870+ return handlerID
1829 }1871 }
1830 1872
1831 fcb := func(clsPtr uintptr, WidgetVarp uintptr, SetupVarp uintptr, SettingsVarp uintptr) {1873 fcb := func(clsPtr uintptr, WidgetVarp uintptr, SetupVarp uintptr, SettingsVarp uintptr) {
@@ -1838,7 +1880,9 @@ func (x *PrintOperation) ConnectUpdateCustomWidget(cb *func(PrintOperation, uint
1838 }1880 }
1839 cbRefPtr := purego.NewCallback(fcb)1881 cbRefPtr := purego.NewCallback(fcb)
1840 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1882 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1841- return gobject.SignalConnect(x.GoPointer(), "update-custom-widget", cbRefPtr)1883+ handlerID := gobject.SignalConnect(x.GoPointer(), "update-custom-widget", cbRefPtr)
1884+ glib.SaveHandlerMapping(handlerID, cbPtr)
1885+ return handlerID
1842 }1886 }
1843 1887
1844 // Ends a preview.1888 // Ends a preview.
M v4/gtk/gtkrange.go +28 -12
@@ -575,10 +575,12 @@ func (x *Range) GetPropertyShowFillLevel() bool {
575 575
576 // Emitted before clamping a value, to give the application a576 // Emitted before clamping a value, to give the application a
577 // chance to adjust the bounds.577 // chance to adjust the bounds.
578-func (x *Range) ConnectAdjustBounds(cb *func(Range, float64)) uint32 {578+func (x *Range) ConnectAdjustBounds(cb *func(Range, float64)) uint {
579 cbPtr := uintptr(unsafe.Pointer(cb))579 cbPtr := uintptr(unsafe.Pointer(cb))
580 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {580 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
581- return gobject.SignalConnect(x.GoPointer(), "adjust-bounds", cbRefPtr)581+ handlerID := gobject.SignalConnect(x.GoPointer(), "adjust-bounds", cbRefPtr)
582+ glib.SaveHandlerMapping(handlerID, cbPtr)
583+ return handlerID
582 }584 }
583 585
584 fcb := func(clsPtr uintptr, ValueVarp float64) {586 fcb := func(clsPtr uintptr, ValueVarp float64) {
@@ -591,7 +593,9 @@ func (x *Range) ConnectAdjustBounds(cb *func(Range, float64)) uint32 {
591 }593 }
592 cbRefPtr := purego.NewCallback(fcb)594 cbRefPtr := purego.NewCallback(fcb)
593 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)595 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
594- return gobject.SignalConnect(x.GoPointer(), "adjust-bounds", cbRefPtr)596+ handlerID := gobject.SignalConnect(x.GoPointer(), "adjust-bounds", cbRefPtr)
597+ glib.SaveHandlerMapping(handlerID, cbPtr)
598+ return handlerID
595 }599 }
596 600
597 // Emitted when a scroll action is performed on a range.601 // Emitted when a scroll action is performed on a range.
@@ -606,10 +610,12 @@ func (x *Range) ConnectAdjustBounds(cb *func(Range, float64)) uint32 {
606 // the ::change-value signal is responsible for clamping the value610 // the ::change-value signal is responsible for clamping the value
607 // to the desired number of decimal digits; the default GTK611 // to the desired number of decimal digits; the default GTK
608 // handler clamps the value based on [property@Gtk.Range:round-digits].612 // handler clamps the value based on [property@Gtk.Range:round-digits].
609-func (x *Range) ConnectChangeValue(cb *func(Range, ScrollType, float64) bool) uint32 {613+func (x *Range) ConnectChangeValue(cb *func(Range, ScrollType, float64) bool) uint {
610 cbPtr := uintptr(unsafe.Pointer(cb))614 cbPtr := uintptr(unsafe.Pointer(cb))
611 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {615 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
612- return gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)616+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)
617+ glib.SaveHandlerMapping(handlerID, cbPtr)
618+ return handlerID
613 }619 }
614 620
615 fcb := func(clsPtr uintptr, ScrollVarp ScrollType, ValueVarp float64) bool {621 fcb := func(clsPtr uintptr, ScrollVarp ScrollType, ValueVarp float64) bool {
@@ -622,16 +628,20 @@ func (x *Range) ConnectChangeValue(cb *func(Range, ScrollType, float64) bool) ui
622 }628 }
623 cbRefPtr := purego.NewCallback(fcb)629 cbRefPtr := purego.NewCallback(fcb)
624 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)630 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
625- return gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)631+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)
632+ glib.SaveHandlerMapping(handlerID, cbPtr)
633+ return handlerID
626 }634 }
627 635
628 // Virtual function that moves the slider.636 // Virtual function that moves the slider.
629 //637 //
630 // Used for keybindings.638 // Used for keybindings.
631-func (x *Range) ConnectMoveSlider(cb *func(Range, ScrollType)) uint32 {639+func (x *Range) ConnectMoveSlider(cb *func(Range, ScrollType)) uint {
632 cbPtr := uintptr(unsafe.Pointer(cb))640 cbPtr := uintptr(unsafe.Pointer(cb))
633 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {641 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
634- return gobject.SignalConnect(x.GoPointer(), "move-slider", cbRefPtr)642+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-slider", cbRefPtr)
643+ glib.SaveHandlerMapping(handlerID, cbPtr)
644+ return handlerID
635 }645 }
636 646
637 fcb := func(clsPtr uintptr, StepVarp ScrollType) {647 fcb := func(clsPtr uintptr, StepVarp ScrollType) {
@@ -644,14 +654,18 @@ func (x *Range) ConnectMoveSlider(cb *func(Range, ScrollType)) uint32 {
644 }654 }
645 cbRefPtr := purego.NewCallback(fcb)655 cbRefPtr := purego.NewCallback(fcb)
646 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)656 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
647- return gobject.SignalConnect(x.GoPointer(), "move-slider", cbRefPtr)657+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-slider", cbRefPtr)
658+ glib.SaveHandlerMapping(handlerID, cbPtr)
659+ return handlerID
648 }660 }
649 661
650 // Emitted when the range value changes.662 // Emitted when the range value changes.
651-func (x *Range) ConnectValueChanged(cb *func(Range)) uint32 {663+func (x *Range) ConnectValueChanged(cb *func(Range)) uint {
652 cbPtr := uintptr(unsafe.Pointer(cb))664 cbPtr := uintptr(unsafe.Pointer(cb))
653 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {665 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
654- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)666+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
667+ glib.SaveHandlerMapping(handlerID, cbPtr)
668+ return handlerID
655 }669 }
656 670
657 fcb := func(clsPtr uintptr) {671 fcb := func(clsPtr uintptr) {
@@ -664,7 +678,9 @@ func (x *Range) ConnectValueChanged(cb *func(Range)) uint32 {
664 }678 }
665 cbRefPtr := purego.NewCallback(fcb)679 cbRefPtr := purego.NewCallback(fcb)
666 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)680 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
667- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)681+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
682+ glib.SaveHandlerMapping(handlerID, cbPtr)
683+ return handlerID
668 }684 }
669 685
670 // Requests the user's screen reader to announce the given message.686 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkrecentmanager.go +7 -3
@@ -818,10 +818,12 @@ func (x *RecentManager) GetPropertySize() int {
818 //818 //
819 // This can happen either by calling [method@Gtk.RecentManager.add_item]819 // This can happen either by calling [method@Gtk.RecentManager.add_item]
820 // or by another application.820 // or by another application.
821-func (x *RecentManager) ConnectChanged(cb *func(RecentManager)) uint32 {821+func (x *RecentManager) ConnectChanged(cb *func(RecentManager)) uint {
822 cbPtr := uintptr(unsafe.Pointer(cb))822 cbPtr := uintptr(unsafe.Pointer(cb))
823 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {823 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
824- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)824+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
825+ glib.SaveHandlerMapping(handlerID, cbPtr)
826+ return handlerID
825 }827 }
826 828
827 fcb := func(clsPtr uintptr) {829 fcb := func(clsPtr uintptr) {
@@ -834,7 +836,9 @@ func (x *RecentManager) ConnectChanged(cb *func(RecentManager)) uint32 {
834 }836 }
835 cbRefPtr := purego.NewCallback(fcb)837 cbRefPtr := purego.NewCallback(fcb)
836 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)838 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
837- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)839+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
840+ glib.SaveHandlerMapping(handlerID, cbPtr)
841+ return handlerID
838 }842 }
839 843
840 var xRecentManagerGetDefault func() uintptr844 var xRecentManagerGetDefault func() uintptr
M v4/gtk/gtkscalebutton.go +21 -9
@@ -362,10 +362,12 @@ func (x *ScaleButton) GetPropertyValue() float64 {
362 // This is a [keybinding signal](class.SignalAction.html).362 // This is a [keybinding signal](class.SignalAction.html).
363 //363 //
364 // The default binding for this signal is &lt;kbd&gt;Escape&lt;/kbd&gt;.364 // The default binding for this signal is &lt;kbd&gt;Escape&lt;/kbd&gt;.
365-func (x *ScaleButton) ConnectPopdown(cb *func(ScaleButton)) uint32 {365+func (x *ScaleButton) ConnectPopdown(cb *func(ScaleButton)) uint {
366 cbPtr := uintptr(unsafe.Pointer(cb))366 cbPtr := uintptr(unsafe.Pointer(cb))
367 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {367 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
368- return gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)368+ handlerID := gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)
369+ glib.SaveHandlerMapping(handlerID, cbPtr)
370+ return handlerID
369 }371 }
370 372
371 fcb := func(clsPtr uintptr) {373 fcb := func(clsPtr uintptr) {
@@ -378,7 +380,9 @@ func (x *ScaleButton) ConnectPopdown(cb *func(ScaleButton)) uint32 {
378 }380 }
379 cbRefPtr := purego.NewCallback(fcb)381 cbRefPtr := purego.NewCallback(fcb)
380 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)382 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
381- return gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)383+ handlerID := gobject.SignalConnect(x.GoPointer(), "popdown", cbRefPtr)
384+ glib.SaveHandlerMapping(handlerID, cbPtr)
385+ return handlerID
382 }386 }
383 387
384 // Emitted to popup the scale widget.388 // Emitted to popup the scale widget.
@@ -387,10 +391,12 @@ func (x *ScaleButton) ConnectPopdown(cb *func(ScaleButton)) uint32 {
387 //391 //
388 // The default bindings for this signal are &lt;kbd&gt;Space&lt;/kbd&gt;,392 // The default bindings for this signal are &lt;kbd&gt;Space&lt;/kbd&gt;,
389 // &lt;kbd&gt;Enter&lt;/kbd&gt; and &lt;kbd&gt;Return&lt;/kbd&gt;.393 // &lt;kbd&gt;Enter&lt;/kbd&gt; and &lt;kbd&gt;Return&lt;/kbd&gt;.
390-func (x *ScaleButton) ConnectPopup(cb *func(ScaleButton)) uint32 {394+func (x *ScaleButton) ConnectPopup(cb *func(ScaleButton)) uint {
391 cbPtr := uintptr(unsafe.Pointer(cb))395 cbPtr := uintptr(unsafe.Pointer(cb))
392 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {396 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
393- return gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)397+ handlerID := gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)
398+ glib.SaveHandlerMapping(handlerID, cbPtr)
399+ return handlerID
394 }400 }
395 401
396 fcb := func(clsPtr uintptr) {402 fcb := func(clsPtr uintptr) {
@@ -403,14 +409,18 @@ func (x *ScaleButton) ConnectPopup(cb *func(ScaleButton)) uint32 {
403 }409 }
404 cbRefPtr := purego.NewCallback(fcb)410 cbRefPtr := purego.NewCallback(fcb)
405 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)411 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
406- return gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)412+ handlerID := gobject.SignalConnect(x.GoPointer(), "popup", cbRefPtr)
413+ glib.SaveHandlerMapping(handlerID, cbPtr)
414+ return handlerID
407 }415 }
408 416
409 // Emitted when the value field has changed.417 // Emitted when the value field has changed.
410-func (x *ScaleButton) ConnectValueChanged(cb *func(ScaleButton, float64)) uint32 {418+func (x *ScaleButton) ConnectValueChanged(cb *func(ScaleButton, float64)) uint {
411 cbPtr := uintptr(unsafe.Pointer(cb))419 cbPtr := uintptr(unsafe.Pointer(cb))
412 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {420 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
413- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)421+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
422+ glib.SaveHandlerMapping(handlerID, cbPtr)
423+ return handlerID
414 }424 }
415 425
416 fcb := func(clsPtr uintptr, ValueVarp float64) {426 fcb := func(clsPtr uintptr, ValueVarp float64) {
@@ -423,7 +433,9 @@ func (x *ScaleButton) ConnectValueChanged(cb *func(ScaleButton, float64)) uint32
423 }433 }
424 cbRefPtr := purego.NewCallback(fcb)434 cbRefPtr := purego.NewCallback(fcb)
425 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)435 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
426- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)436+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
437+ glib.SaveHandlerMapping(handlerID, cbPtr)
438+ return handlerID
427 }439 }
428 440
429 // Requests the user's screen reader to announce the given message.441 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkscrolledwindow.go +28 -12
@@ -784,10 +784,12 @@ func (x *ScrolledWindow) GetPropertyPropagateNaturalWidth() bool {
784 //784 //
785 // Note: The @pos argument is LTR/RTL aware, so callers should be785 // Note: The @pos argument is LTR/RTL aware, so callers should be
786 // aware too if intending to provide behavior on horizontal edges.786 // aware too if intending to provide behavior on horizontal edges.
787-func (x *ScrolledWindow) ConnectEdgeOvershot(cb *func(ScrolledWindow, PositionType)) uint32 {787+func (x *ScrolledWindow) ConnectEdgeOvershot(cb *func(ScrolledWindow, PositionType)) uint {
788 cbPtr := uintptr(unsafe.Pointer(cb))788 cbPtr := uintptr(unsafe.Pointer(cb))
789 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {789 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
790- return gobject.SignalConnect(x.GoPointer(), "edge-overshot", cbRefPtr)790+ handlerID := gobject.SignalConnect(x.GoPointer(), "edge-overshot", cbRefPtr)
791+ glib.SaveHandlerMapping(handlerID, cbPtr)
792+ return handlerID
791 }793 }
792 794
793 fcb := func(clsPtr uintptr, PosVarp PositionType) {795 fcb := func(clsPtr uintptr, PosVarp PositionType) {
@@ -800,7 +802,9 @@ func (x *ScrolledWindow) ConnectEdgeOvershot(cb *func(ScrolledWindow, PositionTy
800 }802 }
801 cbRefPtr := purego.NewCallback(fcb)803 cbRefPtr := purego.NewCallback(fcb)
802 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)804 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
803- return gobject.SignalConnect(x.GoPointer(), "edge-overshot", cbRefPtr)805+ handlerID := gobject.SignalConnect(x.GoPointer(), "edge-overshot", cbRefPtr)
806+ glib.SaveHandlerMapping(handlerID, cbPtr)
807+ return handlerID
804 }808 }
805 809
806 // Emitted whenever user-initiated scrolling makes the scrolled810 // Emitted whenever user-initiated scrolling makes the scrolled
@@ -812,10 +816,12 @@ func (x *ScrolledWindow) ConnectEdgeOvershot(cb *func(ScrolledWindow, PositionTy
812 //816 //
813 // Note: The @pos argument is LTR/RTL aware, so callers should be817 // Note: The @pos argument is LTR/RTL aware, so callers should be
814 // aware too if intending to provide behavior on horizontal edges.818 // aware too if intending to provide behavior on horizontal edges.
815-func (x *ScrolledWindow) ConnectEdgeReached(cb *func(ScrolledWindow, PositionType)) uint32 {819+func (x *ScrolledWindow) ConnectEdgeReached(cb *func(ScrolledWindow, PositionType)) uint {
816 cbPtr := uintptr(unsafe.Pointer(cb))820 cbPtr := uintptr(unsafe.Pointer(cb))
817 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {821 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
818- return gobject.SignalConnect(x.GoPointer(), "edge-reached", cbRefPtr)822+ handlerID := gobject.SignalConnect(x.GoPointer(), "edge-reached", cbRefPtr)
823+ glib.SaveHandlerMapping(handlerID, cbPtr)
824+ return handlerID
819 }825 }
820 826
821 fcb := func(clsPtr uintptr, PosVarp PositionType) {827 fcb := func(clsPtr uintptr, PosVarp PositionType) {
@@ -828,7 +834,9 @@ func (x *ScrolledWindow) ConnectEdgeReached(cb *func(ScrolledWindow, PositionTyp
828 }834 }
829 cbRefPtr := purego.NewCallback(fcb)835 cbRefPtr := purego.NewCallback(fcb)
830 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)836 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
831- return gobject.SignalConnect(x.GoPointer(), "edge-reached", cbRefPtr)837+ handlerID := gobject.SignalConnect(x.GoPointer(), "edge-reached", cbRefPtr)
838+ glib.SaveHandlerMapping(handlerID, cbPtr)
839+ return handlerID
832 }840 }
833 841
834 // Emitted when focus is moved away from the scrolled window by a842 // Emitted when focus is moved away from the scrolled window by a
@@ -839,10 +847,12 @@ func (x *ScrolledWindow) ConnectEdgeReached(cb *func(ScrolledWindow, PositionTyp
839 // The default bindings for this signal are847 // The default bindings for this signal are
840 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt; to move forward and848 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt; to move forward and
841 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt;` to move backward.849 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt;` to move backward.
842-func (x *ScrolledWindow) ConnectMoveFocusOut(cb *func(ScrolledWindow, DirectionType)) uint32 {850+func (x *ScrolledWindow) ConnectMoveFocusOut(cb *func(ScrolledWindow, DirectionType)) uint {
843 cbPtr := uintptr(unsafe.Pointer(cb))851 cbPtr := uintptr(unsafe.Pointer(cb))
844 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {852 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
845- return gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)853+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)
854+ glib.SaveHandlerMapping(handlerID, cbPtr)
855+ return handlerID
846 }856 }
847 857
848 fcb := func(clsPtr uintptr, DirectionTypeVarp DirectionType) {858 fcb := func(clsPtr uintptr, DirectionTypeVarp DirectionType) {
@@ -855,7 +865,9 @@ func (x *ScrolledWindow) ConnectMoveFocusOut(cb *func(ScrolledWindow, DirectionT
855 }865 }
856 cbRefPtr := purego.NewCallback(fcb)866 cbRefPtr := purego.NewCallback(fcb)
857 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)867 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
858- return gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)868+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus-out", cbRefPtr)
869+ glib.SaveHandlerMapping(handlerID, cbPtr)
870+ return handlerID
859 }871 }
860 872
861 // Emitted when a keybinding that scrolls is pressed.873 // Emitted when a keybinding that scrolls is pressed.
@@ -864,10 +876,12 @@ func (x *ScrolledWindow) ConnectMoveFocusOut(cb *func(ScrolledWindow, DirectionT
864 //876 //
865 // The horizontal or vertical adjustment is updated which triggers a877 // The horizontal or vertical adjustment is updated which triggers a
866 // signal that the scrolled window’s child may listen to and scroll itself.878 // signal that the scrolled window’s child may listen to and scroll itself.
867-func (x *ScrolledWindow) ConnectScrollChild(cb *func(ScrolledWindow, ScrollType, bool) bool) uint32 {879+func (x *ScrolledWindow) ConnectScrollChild(cb *func(ScrolledWindow, ScrollType, bool) bool) uint {
868 cbPtr := uintptr(unsafe.Pointer(cb))880 cbPtr := uintptr(unsafe.Pointer(cb))
869 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {881 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
870- return gobject.SignalConnect(x.GoPointer(), "scroll-child", cbRefPtr)882+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll-child", cbRefPtr)
883+ glib.SaveHandlerMapping(handlerID, cbPtr)
884+ return handlerID
871 }885 }
872 886
873 fcb := func(clsPtr uintptr, ScrollVarp ScrollType, HorizontalVarp bool) bool {887 fcb := func(clsPtr uintptr, ScrollVarp ScrollType, HorizontalVarp bool) bool {
@@ -880,7 +894,9 @@ func (x *ScrolledWindow) ConnectScrollChild(cb *func(ScrolledWindow, ScrollType,
880 }894 }
881 cbRefPtr := purego.NewCallback(fcb)895 cbRefPtr := purego.NewCallback(fcb)
882 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)896 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
883- return gobject.SignalConnect(x.GoPointer(), "scroll-child", cbRefPtr)897+ handlerID := gobject.SignalConnect(x.GoPointer(), "scroll-child", cbRefPtr)
898+ glib.SaveHandlerMapping(handlerID, cbPtr)
899+ return handlerID
884 }900 }
885 901
886 // Requests the user's screen reader to announce the given message.902 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtksearchentry.go +42 -18
@@ -295,10 +295,12 @@ func (x *SearchEntry) GetPropertySearchDelay() uint {
295 // Emitted when the entry is activated.295 // Emitted when the entry is activated.
296 //296 //
297 // The keybindings for this signal are all forms of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.297 // The keybindings for this signal are all forms of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.
298-func (x *SearchEntry) ConnectActivate(cb *func(SearchEntry)) uint32 {298+func (x *SearchEntry) ConnectActivate(cb *func(SearchEntry)) uint {
299 cbPtr := uintptr(unsafe.Pointer(cb))299 cbPtr := uintptr(unsafe.Pointer(cb))
300 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {300 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
301- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)301+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
302+ glib.SaveHandlerMapping(handlerID, cbPtr)
303+ return handlerID
302 }304 }
303 305
304 fcb := func(clsPtr uintptr) {306 fcb := func(clsPtr uintptr) {
@@ -311,7 +313,9 @@ func (x *SearchEntry) ConnectActivate(cb *func(SearchEntry)) uint32 {
311 }313 }
312 cbRefPtr := purego.NewCallback(fcb)314 cbRefPtr := purego.NewCallback(fcb)
313 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)315 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
314- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)316+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
317+ glib.SaveHandlerMapping(handlerID, cbPtr)
318+ return handlerID
315 }319 }
316 320
317 // Emitted when the user initiates a move to the next match321 // Emitted when the user initiates a move to the next match
@@ -323,10 +327,12 @@ func (x *SearchEntry) ConnectActivate(cb *func(SearchEntry)) uint32 {
323 // between matches.327 // between matches.
324 //328 //
325 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;g&lt;/kbd&gt;.329 // The default bindings for this signal is &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;g&lt;/kbd&gt;.
326-func (x *SearchEntry) ConnectNextMatch(cb *func(SearchEntry)) uint32 {330+func (x *SearchEntry) ConnectNextMatch(cb *func(SearchEntry)) uint {
327 cbPtr := uintptr(unsafe.Pointer(cb))331 cbPtr := uintptr(unsafe.Pointer(cb))
328 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {332 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
329- return gobject.SignalConnect(x.GoPointer(), "next-match", cbRefPtr)333+ handlerID := gobject.SignalConnect(x.GoPointer(), "next-match", cbRefPtr)
334+ glib.SaveHandlerMapping(handlerID, cbPtr)
335+ return handlerID
330 }336 }
331 337
332 fcb := func(clsPtr uintptr) {338 fcb := func(clsPtr uintptr) {
@@ -339,7 +345,9 @@ func (x *SearchEntry) ConnectNextMatch(cb *func(SearchEntry)) uint32 {
339 }345 }
340 cbRefPtr := purego.NewCallback(fcb)346 cbRefPtr := purego.NewCallback(fcb)
341 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)347 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
342- return gobject.SignalConnect(x.GoPointer(), "next-match", cbRefPtr)348+ handlerID := gobject.SignalConnect(x.GoPointer(), "next-match", cbRefPtr)
349+ glib.SaveHandlerMapping(handlerID, cbPtr)
350+ return handlerID
343 }351 }
344 352
345 // Emitted when the user initiates a move to the previous match353 // Emitted when the user initiates a move to the previous match
@@ -352,10 +360,12 @@ func (x *SearchEntry) ConnectNextMatch(cb *func(SearchEntry)) uint32 {
352 //360 //
353 // The default bindings for this signal is361 // The default bindings for this signal is
354 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;g&lt;/kbd&gt;.362 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;g&lt;/kbd&gt;.
355-func (x *SearchEntry) ConnectPreviousMatch(cb *func(SearchEntry)) uint32 {363+func (x *SearchEntry) ConnectPreviousMatch(cb *func(SearchEntry)) uint {
356 cbPtr := uintptr(unsafe.Pointer(cb))364 cbPtr := uintptr(unsafe.Pointer(cb))
357 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {365 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
358- return gobject.SignalConnect(x.GoPointer(), "previous-match", cbRefPtr)366+ handlerID := gobject.SignalConnect(x.GoPointer(), "previous-match", cbRefPtr)
367+ glib.SaveHandlerMapping(handlerID, cbPtr)
368+ return handlerID
359 }369 }
360 370
361 fcb := func(clsPtr uintptr) {371 fcb := func(clsPtr uintptr) {
@@ -368,16 +378,20 @@ func (x *SearchEntry) ConnectPreviousMatch(cb *func(SearchEntry)) uint32 {
368 }378 }
369 cbRefPtr := purego.NewCallback(fcb)379 cbRefPtr := purego.NewCallback(fcb)
370 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)380 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
371- return gobject.SignalConnect(x.GoPointer(), "previous-match", cbRefPtr)381+ handlerID := gobject.SignalConnect(x.GoPointer(), "previous-match", cbRefPtr)
382+ glib.SaveHandlerMapping(handlerID, cbPtr)
383+ return handlerID
372 }384 }
373 385
374 // Emitted with a delay. The length of the delay can be386 // Emitted with a delay. The length of the delay can be
375 // changed with the [property@Gtk.SearchEntry:search-delay]387 // changed with the [property@Gtk.SearchEntry:search-delay]
376 // property.388 // property.
377-func (x *SearchEntry) ConnectSearchChanged(cb *func(SearchEntry)) uint32 {389+func (x *SearchEntry) ConnectSearchChanged(cb *func(SearchEntry)) uint {
378 cbPtr := uintptr(unsafe.Pointer(cb))390 cbPtr := uintptr(unsafe.Pointer(cb))
379 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {391 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
380- return gobject.SignalConnect(x.GoPointer(), "search-changed", cbRefPtr)392+ handlerID := gobject.SignalConnect(x.GoPointer(), "search-changed", cbRefPtr)
393+ glib.SaveHandlerMapping(handlerID, cbPtr)
394+ return handlerID
381 }395 }
382 396
383 fcb := func(clsPtr uintptr) {397 fcb := func(clsPtr uintptr) {
@@ -390,14 +404,18 @@ func (x *SearchEntry) ConnectSearchChanged(cb *func(SearchEntry)) uint32 {
390 }404 }
391 cbRefPtr := purego.NewCallback(fcb)405 cbRefPtr := purego.NewCallback(fcb)
392 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)406 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
393- return gobject.SignalConnect(x.GoPointer(), "search-changed", cbRefPtr)407+ handlerID := gobject.SignalConnect(x.GoPointer(), "search-changed", cbRefPtr)
408+ glib.SaveHandlerMapping(handlerID, cbPtr)
409+ return handlerID
394 }410 }
395 411
396 // Emitted when the user initiated a search on the entry.412 // Emitted when the user initiated a search on the entry.
397-func (x *SearchEntry) ConnectSearchStarted(cb *func(SearchEntry)) uint32 {413+func (x *SearchEntry) ConnectSearchStarted(cb *func(SearchEntry)) uint {
398 cbPtr := uintptr(unsafe.Pointer(cb))414 cbPtr := uintptr(unsafe.Pointer(cb))
399 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {415 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
400- return gobject.SignalConnect(x.GoPointer(), "search-started", cbRefPtr)416+ handlerID := gobject.SignalConnect(x.GoPointer(), "search-started", cbRefPtr)
417+ glib.SaveHandlerMapping(handlerID, cbPtr)
418+ return handlerID
401 }419 }
402 420
403 fcb := func(clsPtr uintptr) {421 fcb := func(clsPtr uintptr) {
@@ -410,7 +428,9 @@ func (x *SearchEntry) ConnectSearchStarted(cb *func(SearchEntry)) uint32 {
410 }428 }
411 cbRefPtr := purego.NewCallback(fcb)429 cbRefPtr := purego.NewCallback(fcb)
412 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)430 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
413- return gobject.SignalConnect(x.GoPointer(), "search-started", cbRefPtr)431+ handlerID := gobject.SignalConnect(x.GoPointer(), "search-started", cbRefPtr)
432+ glib.SaveHandlerMapping(handlerID, cbPtr)
433+ return handlerID
414 }434 }
415 435
416 // Emitted when the user stops a search via keyboard input.436 // Emitted when the user stops a search via keyboard input.
@@ -421,10 +441,12 @@ func (x *SearchEntry) ConnectSearchStarted(cb *func(SearchEntry)) uint32 {
421 // the search entry in this case.441 // the search entry in this case.
422 //442 //
423 // The default bindings for this signal is &lt;kbd&gt;Escape&lt;/kbd&gt;.443 // The default bindings for this signal is &lt;kbd&gt;Escape&lt;/kbd&gt;.
424-func (x *SearchEntry) ConnectStopSearch(cb *func(SearchEntry)) uint32 {444+func (x *SearchEntry) ConnectStopSearch(cb *func(SearchEntry)) uint {
425 cbPtr := uintptr(unsafe.Pointer(cb))445 cbPtr := uintptr(unsafe.Pointer(cb))
426 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {446 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
427- return gobject.SignalConnect(x.GoPointer(), "stop-search", cbRefPtr)447+ handlerID := gobject.SignalConnect(x.GoPointer(), "stop-search", cbRefPtr)
448+ glib.SaveHandlerMapping(handlerID, cbPtr)
449+ return handlerID
428 }450 }
429 451
430 fcb := func(clsPtr uintptr) {452 fcb := func(clsPtr uintptr) {
@@ -437,7 +459,9 @@ func (x *SearchEntry) ConnectStopSearch(cb *func(SearchEntry)) uint32 {
437 }459 }
438 cbRefPtr := purego.NewCallback(fcb)460 cbRefPtr := purego.NewCallback(fcb)
439 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)461 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
440- return gobject.SignalConnect(x.GoPointer(), "stop-search", cbRefPtr)462+ handlerID := gobject.SignalConnect(x.GoPointer(), "stop-search", cbRefPtr)
463+ glib.SaveHandlerMapping(handlerID, cbPtr)
464+ return handlerID
441 }465 }
442 466
443 // Requests the user's screen reader to announce the given message.467 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkshortcutssection.go +7 -3
@@ -201,10 +201,12 @@ func (x *ShortcutsSection) GetPropertyViewName() string {
201 // The default bindings for this signal are201 // The default bindings for this signal are
202 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgUp&lt;/kbd&gt;,202 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt;, &lt;kbd&gt;PgUp&lt;/kbd&gt;,
203 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt;.203 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;, &lt;kbd&gt;PgDn&lt;/kbd&gt;.
204-func (x *ShortcutsSection) ConnectChangeCurrentPage(cb *func(ShortcutsSection, int) bool) uint32 {204+func (x *ShortcutsSection) ConnectChangeCurrentPage(cb *func(ShortcutsSection, int) bool) uint {
205 cbPtr := uintptr(unsafe.Pointer(cb))205 cbPtr := uintptr(unsafe.Pointer(cb))
206 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {206 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
207- return gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)207+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)
208+ glib.SaveHandlerMapping(handlerID, cbPtr)
209+ return handlerID
208 }210 }
209 211
210 fcb := func(clsPtr uintptr, OffsetVarp int) bool {212 fcb := func(clsPtr uintptr, OffsetVarp int) bool {
@@ -217,7 +219,9 @@ func (x *ShortcutsSection) ConnectChangeCurrentPage(cb *func(ShortcutsSection, i
217 }219 }
218 cbRefPtr := purego.NewCallback(fcb)220 cbRefPtr := purego.NewCallback(fcb)
219 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)221 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
220- return gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)222+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-current-page", cbRefPtr)
223+ glib.SaveHandlerMapping(handlerID, cbPtr)
224+ return handlerID
221 }225 }
222 226
223 // Requests the user's screen reader to announce the given message.227 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkshortcutswindow.go +14 -6
@@ -185,10 +185,12 @@ func (x *ShortcutsWindow) GetPropertyViewName() string {
185 // This is a [keybinding signal](class.SignalAction.html).185 // This is a [keybinding signal](class.SignalAction.html).
186 //186 //
187 // The default binding for this signal is the &lt;kbd&gt;Escape&lt;/kbd&gt; key.187 // The default binding for this signal is the &lt;kbd&gt;Escape&lt;/kbd&gt; key.
188-func (x *ShortcutsWindow) ConnectClose(cb *func(ShortcutsWindow)) uint32 {188+func (x *ShortcutsWindow) ConnectClose(cb *func(ShortcutsWindow)) uint {
189 cbPtr := uintptr(unsafe.Pointer(cb))189 cbPtr := uintptr(unsafe.Pointer(cb))
190 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {190 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
191- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)191+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
192+ glib.SaveHandlerMapping(handlerID, cbPtr)
193+ return handlerID
192 }194 }
193 195
194 fcb := func(clsPtr uintptr) {196 fcb := func(clsPtr uintptr) {
@@ -201,7 +203,9 @@ func (x *ShortcutsWindow) ConnectClose(cb *func(ShortcutsWindow)) uint32 {
201 }203 }
202 cbRefPtr := purego.NewCallback(fcb)204 cbRefPtr := purego.NewCallback(fcb)
203 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)205 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
204- return gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)206+ handlerID := gobject.SignalConnect(x.GoPointer(), "close", cbRefPtr)
207+ glib.SaveHandlerMapping(handlerID, cbPtr)
208+ return handlerID
205 }209 }
206 210
207 // Emitted when the user uses a keybinding to start a search.211 // Emitted when the user uses a keybinding to start a search.
@@ -209,10 +213,12 @@ func (x *ShortcutsWindow) ConnectClose(cb *func(ShortcutsWindow)) uint32 {
209 // This is a [keybinding signal](class.SignalAction.html).213 // This is a [keybinding signal](class.SignalAction.html).
210 //214 //
211 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;+&lt;kbd&gt;F&lt;/kbd&gt;.215 // The default binding for this signal is &lt;kbd&gt;Control&lt;/kbd&gt;+&lt;kbd&gt;F&lt;/kbd&gt;.
212-func (x *ShortcutsWindow) ConnectSearch(cb *func(ShortcutsWindow)) uint32 {216+func (x *ShortcutsWindow) ConnectSearch(cb *func(ShortcutsWindow)) uint {
213 cbPtr := uintptr(unsafe.Pointer(cb))217 cbPtr := uintptr(unsafe.Pointer(cb))
214 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {218 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
215- return gobject.SignalConnect(x.GoPointer(), "search", cbRefPtr)219+ handlerID := gobject.SignalConnect(x.GoPointer(), "search", cbRefPtr)
220+ glib.SaveHandlerMapping(handlerID, cbPtr)
221+ return handlerID
216 }222 }
217 223
218 fcb := func(clsPtr uintptr) {224 fcb := func(clsPtr uintptr) {
@@ -225,7 +231,9 @@ func (x *ShortcutsWindow) ConnectSearch(cb *func(ShortcutsWindow)) uint32 {
225 }231 }
226 cbRefPtr := purego.NewCallback(fcb)232 cbRefPtr := purego.NewCallback(fcb)
227 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)233 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
228- return gobject.SignalConnect(x.GoPointer(), "search", cbRefPtr)234+ handlerID := gobject.SignalConnect(x.GoPointer(), "search", cbRefPtr)
235+ glib.SaveHandlerMapping(handlerID, cbPtr)
236+ return handlerID
229 }237 }
230 238
231 // Requests the user's screen reader to announce the given message.239 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtksignallistitemfactory.go +28 -12
@@ -115,10 +115,12 @@ func (c *SignalListItemFactory) SetGoPointer(ptr uintptr) {
115 // The [signal@Gtk.SignalListItemFactory::unbind] signal is the115 // The [signal@Gtk.SignalListItemFactory::unbind] signal is the
116 // opposite of this signal and can be used to undo everything done116 // opposite of this signal and can be used to undo everything done
117 // in this signal.117 // in this signal.
118-func (x *SignalListItemFactory) ConnectBind(cb *func(SignalListItemFactory, uintptr)) uint32 {118+func (x *SignalListItemFactory) ConnectBind(cb *func(SignalListItemFactory, uintptr)) uint {
119 cbPtr := uintptr(unsafe.Pointer(cb))119 cbPtr := uintptr(unsafe.Pointer(cb))
120 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {120 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
121- return gobject.SignalConnect(x.GoPointer(), "bind", cbRefPtr)121+ handlerID := gobject.SignalConnect(x.GoPointer(), "bind", cbRefPtr)
122+ glib.SaveHandlerMapping(handlerID, cbPtr)
123+ return handlerID
122 }124 }
123 125
124 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {126 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {
@@ -131,7 +133,9 @@ func (x *SignalListItemFactory) ConnectBind(cb *func(SignalListItemFactory, uint
131 }133 }
132 cbRefPtr := purego.NewCallback(fcb)134 cbRefPtr := purego.NewCallback(fcb)
133 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)135 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
134- return gobject.SignalConnect(x.GoPointer(), "bind", cbRefPtr)136+ handlerID := gobject.SignalConnect(x.GoPointer(), "bind", cbRefPtr)
137+ glib.SaveHandlerMapping(handlerID, cbPtr)
138+ return handlerID
135 }139 }
136 140
137 // Emitted when a newly created listitem needs to be prepared for use.141 // Emitted when a newly created listitem needs to be prepared for use.
@@ -143,10 +147,12 @@ func (x *SignalListItemFactory) ConnectBind(cb *func(SignalListItemFactory, uint
143 //147 //
144 // The [signal@Gtk.SignalListItemFactory::teardown] signal is the opposite148 // The [signal@Gtk.SignalListItemFactory::teardown] signal is the opposite
145 // of this signal and can be used to undo everything done in this signal.149 // of this signal and can be used to undo everything done in this signal.
146-func (x *SignalListItemFactory) ConnectSetup(cb *func(SignalListItemFactory, uintptr)) uint32 {150+func (x *SignalListItemFactory) ConnectSetup(cb *func(SignalListItemFactory, uintptr)) uint {
147 cbPtr := uintptr(unsafe.Pointer(cb))151 cbPtr := uintptr(unsafe.Pointer(cb))
148 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {152 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
149- return gobject.SignalConnect(x.GoPointer(), "setup", cbRefPtr)153+ handlerID := gobject.SignalConnect(x.GoPointer(), "setup", cbRefPtr)
154+ glib.SaveHandlerMapping(handlerID, cbPtr)
155+ return handlerID
150 }156 }
151 157
152 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {158 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {
@@ -159,7 +165,9 @@ func (x *SignalListItemFactory) ConnectSetup(cb *func(SignalListItemFactory, uin
159 }165 }
160 cbRefPtr := purego.NewCallback(fcb)166 cbRefPtr := purego.NewCallback(fcb)
161 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)167 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
162- return gobject.SignalConnect(x.GoPointer(), "setup", cbRefPtr)168+ handlerID := gobject.SignalConnect(x.GoPointer(), "setup", cbRefPtr)
169+ glib.SaveHandlerMapping(handlerID, cbPtr)
170+ return handlerID
163 }171 }
164 172
165 // Emitted when an object is about to be destroyed.173 // Emitted when an object is about to be destroyed.
@@ -168,10 +176,12 @@ func (x *SignalListItemFactory) ConnectSetup(cb *func(SignalListItemFactory, uin
168 //176 //
169 // This signal is the opposite of the [signal@Gtk.SignalListItemFactory::setup]177 // This signal is the opposite of the [signal@Gtk.SignalListItemFactory::setup]
170 // signal and should be used to undo everything done in that signal.178 // signal and should be used to undo everything done in that signal.
171-func (x *SignalListItemFactory) ConnectTeardown(cb *func(SignalListItemFactory, uintptr)) uint32 {179+func (x *SignalListItemFactory) ConnectTeardown(cb *func(SignalListItemFactory, uintptr)) uint {
172 cbPtr := uintptr(unsafe.Pointer(cb))180 cbPtr := uintptr(unsafe.Pointer(cb))
173 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {181 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
174- return gobject.SignalConnect(x.GoPointer(), "teardown", cbRefPtr)182+ handlerID := gobject.SignalConnect(x.GoPointer(), "teardown", cbRefPtr)
183+ glib.SaveHandlerMapping(handlerID, cbPtr)
184+ return handlerID
175 }185 }
176 186
177 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {187 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {
@@ -184,7 +194,9 @@ func (x *SignalListItemFactory) ConnectTeardown(cb *func(SignalListItemFactory,
184 }194 }
185 cbRefPtr := purego.NewCallback(fcb)195 cbRefPtr := purego.NewCallback(fcb)
186 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)196 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
187- return gobject.SignalConnect(x.GoPointer(), "teardown", cbRefPtr)197+ handlerID := gobject.SignalConnect(x.GoPointer(), "teardown", cbRefPtr)
198+ glib.SaveHandlerMapping(handlerID, cbPtr)
199+ return handlerID
188 }200 }
189 201
190 // Emitted when an object has been unbound from its item.202 // Emitted when an object has been unbound from its item.
@@ -195,10 +207,12 @@ func (x *SignalListItemFactory) ConnectTeardown(cb *func(SignalListItemFactory,
195 //207 //
196 // This signal is the opposite of the [signal@Gtk.SignalListItemFactory::bind]208 // This signal is the opposite of the [signal@Gtk.SignalListItemFactory::bind]
197 // signal and should be used to undo everything done in that signal.209 // signal and should be used to undo everything done in that signal.
198-func (x *SignalListItemFactory) ConnectUnbind(cb *func(SignalListItemFactory, uintptr)) uint32 {210+func (x *SignalListItemFactory) ConnectUnbind(cb *func(SignalListItemFactory, uintptr)) uint {
199 cbPtr := uintptr(unsafe.Pointer(cb))211 cbPtr := uintptr(unsafe.Pointer(cb))
200 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {212 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
201- return gobject.SignalConnect(x.GoPointer(), "unbind", cbRefPtr)213+ handlerID := gobject.SignalConnect(x.GoPointer(), "unbind", cbRefPtr)
214+ glib.SaveHandlerMapping(handlerID, cbPtr)
215+ return handlerID
202 }216 }
203 217
204 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {218 fcb := func(clsPtr uintptr, ObjectVarp uintptr) {
@@ -211,7 +225,9 @@ func (x *SignalListItemFactory) ConnectUnbind(cb *func(SignalListItemFactory, ui
211 }225 }
212 cbRefPtr := purego.NewCallback(fcb)226 cbRefPtr := purego.NewCallback(fcb)
213 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)227 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
214- return gobject.SignalConnect(x.GoPointer(), "unbind", cbRefPtr)228+ handlerID := gobject.SignalConnect(x.GoPointer(), "unbind", cbRefPtr)
229+ glib.SaveHandlerMapping(handlerID, cbPtr)
230+ return handlerID
215 }231 }
216 232
217 func init() {233 func init() {
M v4/gtk/gtksorter.go +7 -3
@@ -443,10 +443,12 @@ func (c *Sorter) SetGoPointer(ptr uintptr) {
443 // Depending on the @change parameter, it may be possible to update443 // Depending on the @change parameter, it may be possible to update
444 // the sort order without a full resorting. Refer to the444 // the sort order without a full resorting. Refer to the
445 // [enum@Gtk.SorterChange] documentation for details.445 // [enum@Gtk.SorterChange] documentation for details.
446-func (x *Sorter) ConnectChanged(cb *func(Sorter, SorterChange)) uint32 {446+func (x *Sorter) ConnectChanged(cb *func(Sorter, SorterChange)) uint {
447 cbPtr := uintptr(unsafe.Pointer(cb))447 cbPtr := uintptr(unsafe.Pointer(cb))
448 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {448 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
449- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)449+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
450+ glib.SaveHandlerMapping(handlerID, cbPtr)
451+ return handlerID
450 }452 }
451 453
452 fcb := func(clsPtr uintptr, ChangeVarp SorterChange) {454 fcb := func(clsPtr uintptr, ChangeVarp SorterChange) {
@@ -459,7 +461,9 @@ func (x *Sorter) ConnectChanged(cb *func(Sorter, SorterChange)) uint32 {
459 }461 }
460 cbRefPtr := purego.NewCallback(fcb)462 cbRefPtr := purego.NewCallback(fcb)
461 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)463 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
462- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)464+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
465+ glib.SaveHandlerMapping(handlerID, cbPtr)
466+ return handlerID
463 }467 }
464 468
465 func init() {469 func init() {
M v4/gtk/gtkspinbutton.go +42 -18
@@ -689,10 +689,12 @@ func (x *SpinButton) GetPropertyWrap() bool {
689 // If the &lt;kbd&gt;Enter&lt;/kbd&gt; key results in the value being committed to the689 // If the &lt;kbd&gt;Enter&lt;/kbd&gt; key results in the value being committed to the
690 // spin button, then activation does not occur until &lt;kbd&gt;Enter&lt;/kbd&gt; is690 // spin button, then activation does not occur until &lt;kbd&gt;Enter&lt;/kbd&gt; is
691 // pressed again.691 // pressed again.
692-func (x *SpinButton) ConnectActivate(cb *func(SpinButton)) uint32 {692+func (x *SpinButton) ConnectActivate(cb *func(SpinButton)) uint {
693 cbPtr := uintptr(unsafe.Pointer(cb))693 cbPtr := uintptr(unsafe.Pointer(cb))
694 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {694 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
695- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)695+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
696+ glib.SaveHandlerMapping(handlerID, cbPtr)
697+ return handlerID
696 }698 }
697 699
698 fcb := func(clsPtr uintptr) {700 fcb := func(clsPtr uintptr) {
@@ -705,7 +707,9 @@ func (x *SpinButton) ConnectActivate(cb *func(SpinButton)) uint32 {
705 }707 }
706 cbRefPtr := purego.NewCallback(fcb)708 cbRefPtr := purego.NewCallback(fcb)
707 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)709 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
708- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)710+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
711+ glib.SaveHandlerMapping(handlerID, cbPtr)
712+ return handlerID
709 }713 }
710 714
711 // Emitted when the user initiates a value change.715 // Emitted when the user initiates a value change.
@@ -717,10 +721,12 @@ func (x *SpinButton) ConnectActivate(cb *func(SpinButton)) uint32 {
717 // programmatically.721 // programmatically.
718 //722 //
719 // The default bindings for this signal are Up/Down and PageUp/PageDown.723 // The default bindings for this signal are Up/Down and PageUp/PageDown.
720-func (x *SpinButton) ConnectChangeValue(cb *func(SpinButton, ScrollType)) uint32 {724+func (x *SpinButton) ConnectChangeValue(cb *func(SpinButton, ScrollType)) uint {
721 cbPtr := uintptr(unsafe.Pointer(cb))725 cbPtr := uintptr(unsafe.Pointer(cb))
722 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {726 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
723- return gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)727+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)
728+ glib.SaveHandlerMapping(handlerID, cbPtr)
729+ return handlerID
724 }730 }
725 731
726 fcb := func(clsPtr uintptr, ScrollVarp ScrollType) {732 fcb := func(clsPtr uintptr, ScrollVarp ScrollType) {
@@ -733,7 +739,9 @@ func (x *SpinButton) ConnectChangeValue(cb *func(SpinButton, ScrollType)) uint32
733 }739 }
734 cbRefPtr := purego.NewCallback(fcb)740 cbRefPtr := purego.NewCallback(fcb)
735 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)741 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
736- return gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)742+ handlerID := gobject.SignalConnect(x.GoPointer(), "change-value", cbRefPtr)
743+ glib.SaveHandlerMapping(handlerID, cbPtr)
744+ return handlerID
737 }745 }
738 746
739 // Emitted to convert the users input into a double value.747 // Emitted to convert the users input into a double value.
@@ -743,10 +751,12 @@ func (x *SpinButton) ConnectChangeValue(cb *func(SpinButton, ScrollType)) uint32
743 // new value.751 // new value.
744 //752 //
745 // The default conversion uses g_strtod().753 // The default conversion uses g_strtod().
746-func (x *SpinButton) ConnectInput(cb *func(SpinButton, *float64) int) uint32 {754+func (x *SpinButton) ConnectInput(cb *func(SpinButton, *float64) int) uint {
747 cbPtr := uintptr(unsafe.Pointer(cb))755 cbPtr := uintptr(unsafe.Pointer(cb))
748 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {756 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
749- return gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)757+ handlerID := gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)
758+ glib.SaveHandlerMapping(handlerID, cbPtr)
759+ return handlerID
750 }760 }
751 761
752 fcb := func(clsPtr uintptr, NewValueVarp *float64) int {762 fcb := func(clsPtr uintptr, NewValueVarp *float64) int {
@@ -759,7 +769,9 @@ func (x *SpinButton) ConnectInput(cb *func(SpinButton, *float64) int) uint32 {
759 }769 }
760 cbRefPtr := purego.NewCallback(fcb)770 cbRefPtr := purego.NewCallback(fcb)
761 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)771 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
762- return gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)772+ handlerID := gobject.SignalConnect(x.GoPointer(), "input", cbRefPtr)
773+ glib.SaveHandlerMapping(handlerID, cbPtr)
774+ return handlerID
763 }775 }
764 776
765 // Emitted to tweak the formatting of the value for display.777 // Emitted to tweak the formatting of the value for display.
@@ -784,10 +796,12 @@ func (x *SpinButton) ConnectInput(cb *func(SpinButton, *float64) int) uint32 {
784 // }796 // }
785 //797 //
786 // ```798 // ```
787-func (x *SpinButton) ConnectOutput(cb *func(SpinButton) bool) uint32 {799+func (x *SpinButton) ConnectOutput(cb *func(SpinButton) bool) uint {
788 cbPtr := uintptr(unsafe.Pointer(cb))800 cbPtr := uintptr(unsafe.Pointer(cb))
789 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {801 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
790- return gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)802+ handlerID := gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)
803+ glib.SaveHandlerMapping(handlerID, cbPtr)
804+ return handlerID
791 }805 }
792 806
793 fcb := func(clsPtr uintptr) bool {807 fcb := func(clsPtr uintptr) bool {
@@ -800,16 +814,20 @@ func (x *SpinButton) ConnectOutput(cb *func(SpinButton) bool) uint32 {
800 }814 }
801 cbRefPtr := purego.NewCallback(fcb)815 cbRefPtr := purego.NewCallback(fcb)
802 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)816 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
803- return gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)817+ handlerID := gobject.SignalConnect(x.GoPointer(), "output", cbRefPtr)
818+ glib.SaveHandlerMapping(handlerID, cbPtr)
819+ return handlerID
804 }820 }
805 821
806 // Emitted when the value is changed.822 // Emitted when the value is changed.
807 //823 //
808 // Also see the [signal@Gtk.SpinButton::output] signal.824 // Also see the [signal@Gtk.SpinButton::output] signal.
809-func (x *SpinButton) ConnectValueChanged(cb *func(SpinButton)) uint32 {825+func (x *SpinButton) ConnectValueChanged(cb *func(SpinButton)) uint {
810 cbPtr := uintptr(unsafe.Pointer(cb))826 cbPtr := uintptr(unsafe.Pointer(cb))
811 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {827 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
812- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)828+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
829+ glib.SaveHandlerMapping(handlerID, cbPtr)
830+ return handlerID
813 }831 }
814 832
815 fcb := func(clsPtr uintptr) {833 fcb := func(clsPtr uintptr) {
@@ -822,15 +840,19 @@ func (x *SpinButton) ConnectValueChanged(cb *func(SpinButton)) uint32 {
822 }840 }
823 cbRefPtr := purego.NewCallback(fcb)841 cbRefPtr := purego.NewCallback(fcb)
824 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)842 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
825- return gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)843+ handlerID := gobject.SignalConnect(x.GoPointer(), "value-changed", cbRefPtr)
844+ glib.SaveHandlerMapping(handlerID, cbPtr)
845+ return handlerID
826 }846 }
827 847
828 // Emitted right after the spinbutton wraps from its maximum848 // Emitted right after the spinbutton wraps from its maximum
829 // to its minimum value or vice-versa.849 // to its minimum value or vice-versa.
830-func (x *SpinButton) ConnectWrapped(cb *func(SpinButton)) uint32 {850+func (x *SpinButton) ConnectWrapped(cb *func(SpinButton)) uint {
831 cbPtr := uintptr(unsafe.Pointer(cb))851 cbPtr := uintptr(unsafe.Pointer(cb))
832 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {852 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
833- return gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)853+ handlerID := gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)
854+ glib.SaveHandlerMapping(handlerID, cbPtr)
855+ return handlerID
834 }856 }
835 857
836 fcb := func(clsPtr uintptr) {858 fcb := func(clsPtr uintptr) {
@@ -843,7 +865,9 @@ func (x *SpinButton) ConnectWrapped(cb *func(SpinButton)) uint32 {
843 }865 }
844 cbRefPtr := purego.NewCallback(fcb)866 cbRefPtr := purego.NewCallback(fcb)
845 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)867 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
846- return gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)868+ handlerID := gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr)
869+ glib.SaveHandlerMapping(handlerID, cbPtr)
870+ return handlerID
847 }871 }
848 872
849 // Requests the user's screen reader to announce the given message.873 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkstatusbar.go +14 -6
@@ -154,10 +154,12 @@ func (c *Statusbar) SetGoPointer(ptr uintptr) {
154 }154 }
155 155
156 // Emitted whenever a new message is popped off a statusbar's stack.156 // Emitted whenever a new message is popped off a statusbar's stack.
157-func (x *Statusbar) ConnectTextPopped(cb *func(Statusbar, uint, string)) uint32 {157+func (x *Statusbar) ConnectTextPopped(cb *func(Statusbar, uint, string)) uint {
158 cbPtr := uintptr(unsafe.Pointer(cb))158 cbPtr := uintptr(unsafe.Pointer(cb))
159 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {159 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
160- return gobject.SignalConnect(x.GoPointer(), "text-popped", cbRefPtr)160+ handlerID := gobject.SignalConnect(x.GoPointer(), "text-popped", cbRefPtr)
161+ glib.SaveHandlerMapping(handlerID, cbPtr)
162+ return handlerID
161 }163 }
162 164
163 fcb := func(clsPtr uintptr, ContextIdVarp uint, TextVarp string) {165 fcb := func(clsPtr uintptr, ContextIdVarp uint, TextVarp string) {
@@ -170,14 +172,18 @@ func (x *Statusbar) ConnectTextPopped(cb *func(Statusbar, uint, string)) uint32
170 }172 }
171 cbRefPtr := purego.NewCallback(fcb)173 cbRefPtr := purego.NewCallback(fcb)
172 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)174 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
173- return gobject.SignalConnect(x.GoPointer(), "text-popped", cbRefPtr)175+ handlerID := gobject.SignalConnect(x.GoPointer(), "text-popped", cbRefPtr)
176+ glib.SaveHandlerMapping(handlerID, cbPtr)
177+ return handlerID
174 }178 }
175 179
176 // Emitted whenever a new message gets pushed onto a statusbar's stack.180 // Emitted whenever a new message gets pushed onto a statusbar's stack.
177-func (x *Statusbar) ConnectTextPushed(cb *func(Statusbar, uint, string)) uint32 {181+func (x *Statusbar) ConnectTextPushed(cb *func(Statusbar, uint, string)) uint {
178 cbPtr := uintptr(unsafe.Pointer(cb))182 cbPtr := uintptr(unsafe.Pointer(cb))
179 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {183 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
180- return gobject.SignalConnect(x.GoPointer(), "text-pushed", cbRefPtr)184+ handlerID := gobject.SignalConnect(x.GoPointer(), "text-pushed", cbRefPtr)
185+ glib.SaveHandlerMapping(handlerID, cbPtr)
186+ return handlerID
181 }187 }
182 188
183 fcb := func(clsPtr uintptr, ContextIdVarp uint, TextVarp string) {189 fcb := func(clsPtr uintptr, ContextIdVarp uint, TextVarp string) {
@@ -190,7 +196,9 @@ func (x *Statusbar) ConnectTextPushed(cb *func(Statusbar, uint, string)) uint32
190 }196 }
191 cbRefPtr := purego.NewCallback(fcb)197 cbRefPtr := purego.NewCallback(fcb)
192 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)198 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
193- return gobject.SignalConnect(x.GoPointer(), "text-pushed", cbRefPtr)199+ handlerID := gobject.SignalConnect(x.GoPointer(), "text-pushed", cbRefPtr)
200+ glib.SaveHandlerMapping(handlerID, cbPtr)
201+ return handlerID
194 }202 }
195 203
196 // Requests the user's screen reader to announce the given message.204 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkstringlist.go +2 -2
@@ -165,7 +165,7 @@ func (x *StringList) Splice(PositionVar uint, NRemovalsVar uint, AdditionsVar []
165 165
166 }166 }
167 167
168-var xStringListTake func(uintptr, string)168+var xStringListTake func(uintptr, uintptr)
169 169
170 // Adds @string to self at the end, and takes170 // Adds @string to self at the end, and takes
171 // ownership of it.171 // ownership of it.
@@ -178,7 +178,7 @@ var xStringListTake func(uintptr, string)
178 // ```178 // ```
179 func (x *StringList) Take(StringVar string) {179 func (x *StringList) Take(StringVar string) {
180 180
181- xStringListTake(x.GoPointer(), StringVar)181+ xStringListTake(x.GoPointer(), core.GStrdup(StringVar))
182 182
183 }183 }
184 184
M v4/gtk/gtkswitch.go +14 -6
@@ -196,10 +196,12 @@ func (x *Switch) GetPropertyState() bool {
196 //196 //
197 // Applications should never connect to this signal,197 // Applications should never connect to this signal,
198 // but use the [property@Gtk.Switch:active] property.198 // but use the [property@Gtk.Switch:active] property.
199-func (x *Switch) ConnectActivate(cb *func(Switch)) uint32 {199+func (x *Switch) ConnectActivate(cb *func(Switch)) uint {
200 cbPtr := uintptr(unsafe.Pointer(cb))200 cbPtr := uintptr(unsafe.Pointer(cb))
201 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {201 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
202- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)202+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
203+ glib.SaveHandlerMapping(handlerID, cbPtr)
204+ return handlerID
203 }205 }
204 206
205 fcb := func(clsPtr uintptr) {207 fcb := func(clsPtr uintptr) {
@@ -212,7 +214,9 @@ func (x *Switch) ConnectActivate(cb *func(Switch)) uint32 {
212 }214 }
213 cbRefPtr := purego.NewCallback(fcb)215 cbRefPtr := purego.NewCallback(fcb)
214 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)216 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
215- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)217+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
218+ glib.SaveHandlerMapping(handlerID, cbPtr)
219+ return handlerID
216 }220 }
217 221
218 // Emitted to change the underlying state.222 // Emitted to change the underlying state.
@@ -226,10 +230,12 @@ func (x *Switch) ConnectActivate(cb *func(Switch)) uint32 {
226 // [method@Gtk.Switch.set_state] when the underlying state change is230 // [method@Gtk.Switch.set_state] when the underlying state change is
227 // complete. The signal handler should return %TRUE to prevent the231 // complete. The signal handler should return %TRUE to prevent the
228 // default handler from running.232 // default handler from running.
229-func (x *Switch) ConnectStateSet(cb *func(Switch, bool) bool) uint32 {233+func (x *Switch) ConnectStateSet(cb *func(Switch, bool) bool) uint {
230 cbPtr := uintptr(unsafe.Pointer(cb))234 cbPtr := uintptr(unsafe.Pointer(cb))
231 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {235 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
232- return gobject.SignalConnect(x.GoPointer(), "state-set", cbRefPtr)236+ handlerID := gobject.SignalConnect(x.GoPointer(), "state-set", cbRefPtr)
237+ glib.SaveHandlerMapping(handlerID, cbPtr)
238+ return handlerID
233 }239 }
234 240
235 fcb := func(clsPtr uintptr, StateVarp bool) bool {241 fcb := func(clsPtr uintptr, StateVarp bool) bool {
@@ -242,7 +248,9 @@ func (x *Switch) ConnectStateSet(cb *func(Switch, bool) bool) uint32 {
242 }248 }
243 cbRefPtr := purego.NewCallback(fcb)249 cbRefPtr := purego.NewCallback(fcb)
244 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)250 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
245- return gobject.SignalConnect(x.GoPointer(), "state-set", cbRefPtr)251+ handlerID := gobject.SignalConnect(x.GoPointer(), "state-set", cbRefPtr)
252+ glib.SaveHandlerMapping(handlerID, cbPtr)
253+ return handlerID
246 }254 }
247 255
248 // Requests the user's screen reader to announce the given message.256 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtktext.go +77 -33
@@ -875,10 +875,12 @@ func (x *Text) GetPropertyVisibility() bool {
875 //875 //
876 // The default bindings for this signal are all forms876 // The default bindings for this signal are all forms
877 // of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.877 // of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.
878-func (x *Text) ConnectActivate(cb *func(Text)) uint32 {878+func (x *Text) ConnectActivate(cb *func(Text)) uint {
879 cbPtr := uintptr(unsafe.Pointer(cb))879 cbPtr := uintptr(unsafe.Pointer(cb))
880 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {880 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
881- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)881+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
882+ glib.SaveHandlerMapping(handlerID, cbPtr)
883+ return handlerID
882 }884 }
883 885
884 fcb := func(clsPtr uintptr) {886 fcb := func(clsPtr uintptr) {
@@ -891,7 +893,9 @@ func (x *Text) ConnectActivate(cb *func(Text)) uint32 {
891 }893 }
892 cbRefPtr := purego.NewCallback(fcb)894 cbRefPtr := purego.NewCallback(fcb)
893 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)895 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
894- return gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)896+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
897+ glib.SaveHandlerMapping(handlerID, cbPtr)
898+ return handlerID
895 }899 }
896 900
897 // Emitted when the user asks for it.901 // Emitted when the user asks for it.
@@ -900,10 +904,12 @@ func (x *Text) ConnectActivate(cb *func(Text)) uint32 {
900 //904 //
901 // The default bindings for this signal are905 // The default bindings for this signal are
902 // &lt;kbd&gt;Backspace&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt;.906 // &lt;kbd&gt;Backspace&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt;.
903-func (x *Text) ConnectBackspace(cb *func(Text)) uint32 {907+func (x *Text) ConnectBackspace(cb *func(Text)) uint {
904 cbPtr := uintptr(unsafe.Pointer(cb))908 cbPtr := uintptr(unsafe.Pointer(cb))
905 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {909 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
906- return gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)910+ handlerID := gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)
911+ glib.SaveHandlerMapping(handlerID, cbPtr)
912+ return handlerID
907 }913 }
908 914
909 fcb := func(clsPtr uintptr) {915 fcb := func(clsPtr uintptr) {
@@ -916,7 +922,9 @@ func (x *Text) ConnectBackspace(cb *func(Text)) uint32 {
916 }922 }
917 cbRefPtr := purego.NewCallback(fcb)923 cbRefPtr := purego.NewCallback(fcb)
918 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)924 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
919- return gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)925+ handlerID := gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)
926+ glib.SaveHandlerMapping(handlerID, cbPtr)
927+ return handlerID
920 }928 }
921 929
922 // Emitted to copy the selection to the clipboard.930 // Emitted to copy the selection to the clipboard.
@@ -926,10 +934,12 @@ func (x *Text) ConnectBackspace(cb *func(Text)) uint32 {
926 // The default bindings for this signal are934 // The default bindings for this signal are
927 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; and935 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; and
928 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.936 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.
929-func (x *Text) ConnectCopyClipboard(cb *func(Text)) uint32 {937+func (x *Text) ConnectCopyClipboard(cb *func(Text)) uint {
930 cbPtr := uintptr(unsafe.Pointer(cb))938 cbPtr := uintptr(unsafe.Pointer(cb))
931 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {939 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
932- return gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)940+ handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
941+ glib.SaveHandlerMapping(handlerID, cbPtr)
942+ return handlerID
933 }943 }
934 944
935 fcb := func(clsPtr uintptr) {945 fcb := func(clsPtr uintptr) {
@@ -942,7 +952,9 @@ func (x *Text) ConnectCopyClipboard(cb *func(Text)) uint32 {
942 }952 }
943 cbRefPtr := purego.NewCallback(fcb)953 cbRefPtr := purego.NewCallback(fcb)
944 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)954 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
945- return gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)955+ handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
956+ glib.SaveHandlerMapping(handlerID, cbPtr)
957+ return handlerID
946 }958 }
947 959
948 // Emitted to cut the selection to the clipboard.960 // Emitted to cut the selection to the clipboard.
@@ -952,10 +964,12 @@ func (x *Text) ConnectCopyClipboard(cb *func(Text)) uint32 {
952 // The default bindings for this signal are964 // The default bindings for this signal are
953 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt; and965 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt; and
954 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt;.966 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt;.
955-func (x *Text) ConnectCutClipboard(cb *func(Text)) uint32 {967+func (x *Text) ConnectCutClipboard(cb *func(Text)) uint {
956 cbPtr := uintptr(unsafe.Pointer(cb))968 cbPtr := uintptr(unsafe.Pointer(cb))
957 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {969 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
958- return gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)970+ handlerID := gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)
971+ glib.SaveHandlerMapping(handlerID, cbPtr)
972+ return handlerID
959 }973 }
960 974
961 fcb := func(clsPtr uintptr) {975 fcb := func(clsPtr uintptr) {
@@ -968,7 +982,9 @@ func (x *Text) ConnectCutClipboard(cb *func(Text)) uint32 {
968 }982 }
969 cbRefPtr := purego.NewCallback(fcb)983 cbRefPtr := purego.NewCallback(fcb)
970 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)984 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
971- return gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)985+ handlerID := gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)
986+ glib.SaveHandlerMapping(handlerID, cbPtr)
987+ return handlerID
972 }988 }
973 989
974 // Emitted when the user initiates a text deletion.990 // Emitted when the user initiates a text deletion.
@@ -982,10 +998,12 @@ func (x *Text) ConnectCutClipboard(cb *func(Text)) uint32 {
982 // The default bindings for this signal are &lt;kbd&gt;Delete&lt;/kbd&gt;998 // The default bindings for this signal are &lt;kbd&gt;Delete&lt;/kbd&gt;
983 // for deleting a character and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt;999 // for deleting a character and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt;
984 // for deleting a word.1000 // for deleting a word.
985-func (x *Text) ConnectDeleteFromCursor(cb *func(Text, DeleteType, int)) uint32 {1001+func (x *Text) ConnectDeleteFromCursor(cb *func(Text, DeleteType, int)) uint {
986 cbPtr := uintptr(unsafe.Pointer(cb))1002 cbPtr := uintptr(unsafe.Pointer(cb))
987 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1003 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
988- return gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)1004+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)
1005+ glib.SaveHandlerMapping(handlerID, cbPtr)
1006+ return handlerID
989 }1007 }
990 1008
991 fcb := func(clsPtr uintptr, TypeVarp DeleteType, CountVarp int) {1009 fcb := func(clsPtr uintptr, TypeVarp DeleteType, CountVarp int) {
@@ -998,7 +1016,9 @@ func (x *Text) ConnectDeleteFromCursor(cb *func(Text, DeleteType, int)) uint32 {
998 }1016 }
999 cbRefPtr := purego.NewCallback(fcb)1017 cbRefPtr := purego.NewCallback(fcb)
1000 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1018 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1001- return gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)1019+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)
1020+ glib.SaveHandlerMapping(handlerID, cbPtr)
1021+ return handlerID
1002 }1022 }
1003 1023
1004 // Emitted when the user initiates the insertion of a1024 // Emitted when the user initiates the insertion of a
@@ -1007,10 +1027,12 @@ func (x *Text) ConnectDeleteFromCursor(cb *func(Text, DeleteType, int)) uint32 {
1007 // This is a [keybinding signal](class.SignalAction.html).1027 // This is a [keybinding signal](class.SignalAction.html).
1008 //1028 //
1009 // This signal has no default bindings.1029 // This signal has no default bindings.
1010-func (x *Text) ConnectInsertAtCursor(cb *func(Text, string)) uint32 {1030+func (x *Text) ConnectInsertAtCursor(cb *func(Text, string)) uint {
1011 cbPtr := uintptr(unsafe.Pointer(cb))1031 cbPtr := uintptr(unsafe.Pointer(cb))
1012 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1032 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1013- return gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)1033+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)
1034+ glib.SaveHandlerMapping(handlerID, cbPtr)
1035+ return handlerID
1014 }1036 }
1015 1037
1016 fcb := func(clsPtr uintptr, StringVarp string) {1038 fcb := func(clsPtr uintptr, StringVarp string) {
@@ -1023,7 +1045,9 @@ func (x *Text) ConnectInsertAtCursor(cb *func(Text, string)) uint32 {
1023 }1045 }
1024 cbRefPtr := purego.NewCallback(fcb)1046 cbRefPtr := purego.NewCallback(fcb)
1025 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1047 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1026- return gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)1048+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)
1049+ glib.SaveHandlerMapping(handlerID, cbPtr)
1050+ return handlerID
1027 }1051 }
1028 1052
1029 // Emitted to present the Emoji chooser.1053 // Emitted to present the Emoji chooser.
@@ -1033,10 +1057,12 @@ func (x *Text) ConnectInsertAtCursor(cb *func(Text, string)) uint32 {
1033 // The default bindings for this signal are1057 // The default bindings for this signal are
1034 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;.&lt;/kbd&gt; and1058 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;.&lt;/kbd&gt; and
1035 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;;&lt;/kbd&gt;1059 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;;&lt;/kbd&gt;
1036-func (x *Text) ConnectInsertEmoji(cb *func(Text)) uint32 {1060+func (x *Text) ConnectInsertEmoji(cb *func(Text)) uint {
1037 cbPtr := uintptr(unsafe.Pointer(cb))1061 cbPtr := uintptr(unsafe.Pointer(cb))
1038 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1062 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1039- return gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)1063+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)
1064+ glib.SaveHandlerMapping(handlerID, cbPtr)
1065+ return handlerID
1040 }1066 }
1041 1067
1042 fcb := func(clsPtr uintptr) {1068 fcb := func(clsPtr uintptr) {
@@ -1049,7 +1075,9 @@ func (x *Text) ConnectInsertEmoji(cb *func(Text)) uint32 {
1049 }1075 }
1050 cbRefPtr := purego.NewCallback(fcb)1076 cbRefPtr := purego.NewCallback(fcb)
1051 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1077 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1052- return gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)1078+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)
1079+ glib.SaveHandlerMapping(handlerID, cbPtr)
1080+ return handlerID
1053 }1081 }
1054 1082
1055 // Emitted when the user initiates a cursor movement.1083 // Emitted when the user initiates a cursor movement.
@@ -1072,10 +1100,12 @@ func (x *Text) ConnectInsertEmoji(cb *func(Text)) uint32 {
1072 // move by individual characters/lines1100 // move by individual characters/lines
1073 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, etc. move by words/paragraphs1101 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;, etc. move by words/paragraphs
1074 // - &lt;kbd&gt;Home&lt;/kbd&gt; and &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the buffer1102 // - &lt;kbd&gt;Home&lt;/kbd&gt; and &lt;kbd&gt;End&lt;/kbd&gt; move to the ends of the buffer
1075-func (x *Text) ConnectMoveCursor(cb *func(Text, MovementStep, int, bool)) uint32 {1103+func (x *Text) ConnectMoveCursor(cb *func(Text, MovementStep, int, bool)) uint {
1076 cbPtr := uintptr(unsafe.Pointer(cb))1104 cbPtr := uintptr(unsafe.Pointer(cb))
1077 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1105 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1078- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)1106+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
1107+ glib.SaveHandlerMapping(handlerID, cbPtr)
1108+ return handlerID
1079 }1109 }
1080 1110
1081 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool) {1111 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendVarp bool) {
@@ -1088,7 +1118,9 @@ func (x *Text) ConnectMoveCursor(cb *func(Text, MovementStep, int, bool)) uint32
1088 }1118 }
1089 cbRefPtr := purego.NewCallback(fcb)1119 cbRefPtr := purego.NewCallback(fcb)
1090 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1120 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1091- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)1121+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
1122+ glib.SaveHandlerMapping(handlerID, cbPtr)
1123+ return handlerID
1092 }1124 }
1093 1125
1094 // Emitted to paste the contents of the clipboard.1126 // Emitted to paste the contents of the clipboard.
@@ -1097,10 +1129,12 @@ func (x *Text) ConnectMoveCursor(cb *func(Text, MovementStep, int, bool)) uint32
1097 //1129 //
1098 // The default bindings for this signal are1130 // The default bindings for this signal are
1099 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;v&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.1131 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;v&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.
1100-func (x *Text) ConnectPasteClipboard(cb *func(Text)) uint32 {1132+func (x *Text) ConnectPasteClipboard(cb *func(Text)) uint {
1101 cbPtr := uintptr(unsafe.Pointer(cb))1133 cbPtr := uintptr(unsafe.Pointer(cb))
1102 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1134 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1103- return gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)1135+ handlerID := gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)
1136+ glib.SaveHandlerMapping(handlerID, cbPtr)
1137+ return handlerID
1104 }1138 }
1105 1139
1106 fcb := func(clsPtr uintptr) {1140 fcb := func(clsPtr uintptr) {
@@ -1113,7 +1147,9 @@ func (x *Text) ConnectPasteClipboard(cb *func(Text)) uint32 {
1113 }1147 }
1114 cbRefPtr := purego.NewCallback(fcb)1148 cbRefPtr := purego.NewCallback(fcb)
1115 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1149 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1116- return gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)1150+ handlerID := gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)
1151+ glib.SaveHandlerMapping(handlerID, cbPtr)
1152+ return handlerID
1117 }1153 }
1118 1154
1119 // Emitted when the preedit text changes.1155 // Emitted when the preedit text changes.
@@ -1121,10 +1157,12 @@ func (x *Text) ConnectPasteClipboard(cb *func(Text)) uint32 {
1121 // If an input method is used, the typed text will not immediately1157 // If an input method is used, the typed text will not immediately
1122 // be committed to the buffer. So if you are interested in the text,1158 // be committed to the buffer. So if you are interested in the text,
1123 // connect to this signal.1159 // connect to this signal.
1124-func (x *Text) ConnectPreeditChanged(cb *func(Text, string)) uint32 {1160+func (x *Text) ConnectPreeditChanged(cb *func(Text, string)) uint {
1125 cbPtr := uintptr(unsafe.Pointer(cb))1161 cbPtr := uintptr(unsafe.Pointer(cb))
1126 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1162 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1127- return gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)1163+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
1164+ glib.SaveHandlerMapping(handlerID, cbPtr)
1165+ return handlerID
1128 }1166 }
1129 1167
1130 fcb := func(clsPtr uintptr, PreeditVarp string) {1168 fcb := func(clsPtr uintptr, PreeditVarp string) {
@@ -1137,7 +1175,9 @@ func (x *Text) ConnectPreeditChanged(cb *func(Text, string)) uint32 {
1137 }1175 }
1138 cbRefPtr := purego.NewCallback(fcb)1176 cbRefPtr := purego.NewCallback(fcb)
1139 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1177 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1140- return gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)1178+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
1179+ glib.SaveHandlerMapping(handlerID, cbPtr)
1180+ return handlerID
1141 }1181 }
1142 1182
1143 // Emitted to toggle the overwrite mode.1183 // Emitted to toggle the overwrite mode.
@@ -1145,10 +1185,12 @@ func (x *Text) ConnectPreeditChanged(cb *func(Text, string)) uint32 {
1145 // This is a [keybinding signal](class.SignalAction.html).1185 // This is a [keybinding signal](class.SignalAction.html).
1146 //1186 //
1147 // The default bindings for this signal is &lt;kbd&gt;Insert&lt;/kbd&gt;.1187 // The default bindings for this signal is &lt;kbd&gt;Insert&lt;/kbd&gt;.
1148-func (x *Text) ConnectToggleOverwrite(cb *func(Text)) uint32 {1188+func (x *Text) ConnectToggleOverwrite(cb *func(Text)) uint {
1149 cbPtr := uintptr(unsafe.Pointer(cb))1189 cbPtr := uintptr(unsafe.Pointer(cb))
1150 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1190 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1151- return gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)1191+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)
1192+ glib.SaveHandlerMapping(handlerID, cbPtr)
1193+ return handlerID
1152 }1194 }
1153 1195
1154 fcb := func(clsPtr uintptr) {1196 fcb := func(clsPtr uintptr) {
@@ -1161,7 +1203,9 @@ func (x *Text) ConnectToggleOverwrite(cb *func(Text)) uint32 {
1161 }1203 }
1162 cbRefPtr := purego.NewCallback(fcb)1204 cbRefPtr := purego.NewCallback(fcb)
1163 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1205 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1164- return gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)1206+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)
1207+ glib.SaveHandlerMapping(handlerID, cbPtr)
1208+ return handlerID
1165 }1209 }
1166 1210
1167 // Requests the user's screen reader to announce the given message.1211 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtktextbuffer.go +105 -45
@@ -1882,10 +1882,12 @@ func (x *TextBuffer) GetPropertyText() string {
1882 // [method@Gtk.TextBuffer.apply_tag],1882 // [method@Gtk.TextBuffer.apply_tag],
1883 // [method@Gtk.TextBuffer.insert_with_tags],1883 // [method@Gtk.TextBuffer.insert_with_tags],
1884 // [method@Gtk.TextBuffer.insert_range].1884 // [method@Gtk.TextBuffer.insert_range].
1885-func (x *TextBuffer) ConnectApplyTag(cb *func(TextBuffer, uintptr, uintptr, uintptr)) uint32 {1885+func (x *TextBuffer) ConnectApplyTag(cb *func(TextBuffer, uintptr, uintptr, uintptr)) uint {
1886 cbPtr := uintptr(unsafe.Pointer(cb))1886 cbPtr := uintptr(unsafe.Pointer(cb))
1887 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1887 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1888- return gobject.SignalConnect(x.GoPointer(), "apply-tag", cbRefPtr)1888+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply-tag", cbRefPtr)
1889+ glib.SaveHandlerMapping(handlerID, cbPtr)
1890+ return handlerID
1889 }1891 }
1890 1892
1891 fcb := func(clsPtr uintptr, TagVarp uintptr, StartVarp uintptr, EndVarp uintptr) {1893 fcb := func(clsPtr uintptr, TagVarp uintptr, StartVarp uintptr, EndVarp uintptr) {
@@ -1898,7 +1900,9 @@ func (x *TextBuffer) ConnectApplyTag(cb *func(TextBuffer, uintptr, uintptr, uint
1898 }1900 }
1899 cbRefPtr := purego.NewCallback(fcb)1901 cbRefPtr := purego.NewCallback(fcb)
1900 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1902 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1901- return gobject.SignalConnect(x.GoPointer(), "apply-tag", cbRefPtr)1903+ handlerID := gobject.SignalConnect(x.GoPointer(), "apply-tag", cbRefPtr)
1904+ glib.SaveHandlerMapping(handlerID, cbPtr)
1905+ return handlerID
1902 }1906 }
1903 1907
1904 // Emitted at the beginning of a single user-visible1908 // Emitted at the beginning of a single user-visible
@@ -1911,10 +1915,12 @@ func (x *TextBuffer) ConnectApplyTag(cb *func(TextBuffer, uintptr, uintptr, uint
1911 // [method@Gtk.TextBuffer.delete_interactive],1915 // [method@Gtk.TextBuffer.delete_interactive],
1912 // [method@Gtk.TextBuffer.backspace],1916 // [method@Gtk.TextBuffer.backspace],
1913 // [method@Gtk.TextBuffer.delete_selection].1917 // [method@Gtk.TextBuffer.delete_selection].
1914-func (x *TextBuffer) ConnectBeginUserAction(cb *func(TextBuffer)) uint32 {1918+func (x *TextBuffer) ConnectBeginUserAction(cb *func(TextBuffer)) uint {
1915 cbPtr := uintptr(unsafe.Pointer(cb))1919 cbPtr := uintptr(unsafe.Pointer(cb))
1916 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1920 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1917- return gobject.SignalConnect(x.GoPointer(), "begin-user-action", cbRefPtr)1921+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin-user-action", cbRefPtr)
1922+ glib.SaveHandlerMapping(handlerID, cbPtr)
1923+ return handlerID
1918 }1924 }
1919 1925
1920 fcb := func(clsPtr uintptr) {1926 fcb := func(clsPtr uintptr) {
@@ -1927,14 +1933,18 @@ func (x *TextBuffer) ConnectBeginUserAction(cb *func(TextBuffer)) uint32 {
1927 }1933 }
1928 cbRefPtr := purego.NewCallback(fcb)1934 cbRefPtr := purego.NewCallback(fcb)
1929 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1935 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1930- return gobject.SignalConnect(x.GoPointer(), "begin-user-action", cbRefPtr)1936+ handlerID := gobject.SignalConnect(x.GoPointer(), "begin-user-action", cbRefPtr)
1937+ glib.SaveHandlerMapping(handlerID, cbPtr)
1938+ return handlerID
1931 }1939 }
1932 1940
1933 // Emitted when the content of a `GtkTextBuffer` has changed.1941 // Emitted when the content of a `GtkTextBuffer` has changed.
1934-func (x *TextBuffer) ConnectChanged(cb *func(TextBuffer)) uint32 {1942+func (x *TextBuffer) ConnectChanged(cb *func(TextBuffer)) uint {
1935 cbPtr := uintptr(unsafe.Pointer(cb))1943 cbPtr := uintptr(unsafe.Pointer(cb))
1936 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1944 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1937- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)1945+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1946+ glib.SaveHandlerMapping(handlerID, cbPtr)
1947+ return handlerID
1938 }1948 }
1939 1949
1940 fcb := func(clsPtr uintptr) {1950 fcb := func(clsPtr uintptr) {
@@ -1947,7 +1957,9 @@ func (x *TextBuffer) ConnectChanged(cb *func(TextBuffer)) uint32 {
1947 }1957 }
1948 cbRefPtr := purego.NewCallback(fcb)1958 cbRefPtr := purego.NewCallback(fcb)
1949 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1959 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1950- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)1960+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
1961+ glib.SaveHandlerMapping(handlerID, cbPtr)
1962+ return handlerID
1951 }1963 }
1952 1964
1953 // Emitted to delete a range from a `GtkTextBuffer`.1965 // Emitted to delete a range from a `GtkTextBuffer`.
@@ -1961,10 +1973,12 @@ func (x *TextBuffer) ConnectChanged(cb *func(TextBuffer)) uint32 {
1961 // the deleted text.1973 // the deleted text.
1962 //1974 //
1963 // See also: [method@Gtk.TextBuffer.delete].1975 // See also: [method@Gtk.TextBuffer.delete].
1964-func (x *TextBuffer) ConnectDeleteRange(cb *func(TextBuffer, uintptr, uintptr)) uint32 {1976+func (x *TextBuffer) ConnectDeleteRange(cb *func(TextBuffer, uintptr, uintptr)) uint {
1965 cbPtr := uintptr(unsafe.Pointer(cb))1977 cbPtr := uintptr(unsafe.Pointer(cb))
1966 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1978 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1967- return gobject.SignalConnect(x.GoPointer(), "delete-range", cbRefPtr)1979+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-range", cbRefPtr)
1980+ glib.SaveHandlerMapping(handlerID, cbPtr)
1981+ return handlerID
1968 }1982 }
1969 1983
1970 fcb := func(clsPtr uintptr, StartVarp uintptr, EndVarp uintptr) {1984 fcb := func(clsPtr uintptr, StartVarp uintptr, EndVarp uintptr) {
@@ -1977,7 +1991,9 @@ func (x *TextBuffer) ConnectDeleteRange(cb *func(TextBuffer, uintptr, uintptr))
1977 }1991 }
1978 cbRefPtr := purego.NewCallback(fcb)1992 cbRefPtr := purego.NewCallback(fcb)
1979 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1993 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1980- return gobject.SignalConnect(x.GoPointer(), "delete-range", cbRefPtr)1994+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-range", cbRefPtr)
1995+ glib.SaveHandlerMapping(handlerID, cbPtr)
1996+ return handlerID
1981 }1997 }
1982 1998
1983 // Emitted at the end of a single user-visible1999 // Emitted at the end of a single user-visible
@@ -1991,10 +2007,12 @@ func (x *TextBuffer) ConnectDeleteRange(cb *func(TextBuffer, uintptr, uintptr))
1991 // [method@Gtk.TextBuffer.backspace],2007 // [method@Gtk.TextBuffer.backspace],
1992 // [method@Gtk.TextBuffer.delete_selection],2008 // [method@Gtk.TextBuffer.delete_selection],
1993 // [method@Gtk.TextBuffer.backspace].2009 // [method@Gtk.TextBuffer.backspace].
1994-func (x *TextBuffer) ConnectEndUserAction(cb *func(TextBuffer)) uint32 {2010+func (x *TextBuffer) ConnectEndUserAction(cb *func(TextBuffer)) uint {
1995 cbPtr := uintptr(unsafe.Pointer(cb))2011 cbPtr := uintptr(unsafe.Pointer(cb))
1996 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2012 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1997- return gobject.SignalConnect(x.GoPointer(), "end-user-action", cbRefPtr)2013+ handlerID := gobject.SignalConnect(x.GoPointer(), "end-user-action", cbRefPtr)
2014+ glib.SaveHandlerMapping(handlerID, cbPtr)
2015+ return handlerID
1998 }2016 }
1999 2017
2000 fcb := func(clsPtr uintptr) {2018 fcb := func(clsPtr uintptr) {
@@ -2007,7 +2025,9 @@ func (x *TextBuffer) ConnectEndUserAction(cb *func(TextBuffer)) uint32 {
2007 }2025 }
2008 cbRefPtr := purego.NewCallback(fcb)2026 cbRefPtr := purego.NewCallback(fcb)
2009 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2027 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2010- return gobject.SignalConnect(x.GoPointer(), "end-user-action", cbRefPtr)2028+ handlerID := gobject.SignalConnect(x.GoPointer(), "end-user-action", cbRefPtr)
2029+ glib.SaveHandlerMapping(handlerID, cbPtr)
2030+ return handlerID
2011 }2031 }
2012 2032
2013 // Emitted to insert a `GtkTextChildAnchor` in a `GtkTextBuffer`.2033 // Emitted to insert a `GtkTextChildAnchor` in a `GtkTextBuffer`.
@@ -2020,10 +2040,12 @@ func (x *TextBuffer) ConnectEndUserAction(cb *func(TextBuffer)) uint32 {
2020 // it to be placed after the inserted @anchor.2040 // it to be placed after the inserted @anchor.
2021 //2041 //
2022 // See also: [method@Gtk.TextBuffer.insert_child_anchor].2042 // See also: [method@Gtk.TextBuffer.insert_child_anchor].
2023-func (x *TextBuffer) ConnectInsertChildAnchor(cb *func(TextBuffer, uintptr, uintptr)) uint32 {2043+func (x *TextBuffer) ConnectInsertChildAnchor(cb *func(TextBuffer, uintptr, uintptr)) uint {
2024 cbPtr := uintptr(unsafe.Pointer(cb))2044 cbPtr := uintptr(unsafe.Pointer(cb))
2025 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2045 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2026- return gobject.SignalConnect(x.GoPointer(), "insert-child-anchor", cbRefPtr)2046+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-child-anchor", cbRefPtr)
2047+ glib.SaveHandlerMapping(handlerID, cbPtr)
2048+ return handlerID
2027 }2049 }
2028 2050
2029 fcb := func(clsPtr uintptr, LocationVarp uintptr, AnchorVarp uintptr) {2051 fcb := func(clsPtr uintptr, LocationVarp uintptr, AnchorVarp uintptr) {
@@ -2036,7 +2058,9 @@ func (x *TextBuffer) ConnectInsertChildAnchor(cb *func(TextBuffer, uintptr, uint
2036 }2058 }
2037 cbRefPtr := purego.NewCallback(fcb)2059 cbRefPtr := purego.NewCallback(fcb)
2038 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2060 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2039- return gobject.SignalConnect(x.GoPointer(), "insert-child-anchor", cbRefPtr)2061+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-child-anchor", cbRefPtr)
2062+ glib.SaveHandlerMapping(handlerID, cbPtr)
2063+ return handlerID
2040 }2064 }
2041 2065
2042 // Emitted to insert a `GdkPaintable` in a `GtkTextBuffer`.2066 // Emitted to insert a `GdkPaintable` in a `GtkTextBuffer`.
@@ -2049,10 +2073,12 @@ func (x *TextBuffer) ConnectInsertChildAnchor(cb *func(TextBuffer, uintptr, uint
2049 // it to be placed after the inserted @paintable.2073 // it to be placed after the inserted @paintable.
2050 //2074 //
2051 // See also: [method@Gtk.TextBuffer.insert_paintable].2075 // See also: [method@Gtk.TextBuffer.insert_paintable].
2052-func (x *TextBuffer) ConnectInsertPaintable(cb *func(TextBuffer, uintptr, uintptr)) uint32 {2076+func (x *TextBuffer) ConnectInsertPaintable(cb *func(TextBuffer, uintptr, uintptr)) uint {
2053 cbPtr := uintptr(unsafe.Pointer(cb))2077 cbPtr := uintptr(unsafe.Pointer(cb))
2054 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2078 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2055- return gobject.SignalConnect(x.GoPointer(), "insert-paintable", cbRefPtr)2079+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-paintable", cbRefPtr)
2080+ glib.SaveHandlerMapping(handlerID, cbPtr)
2081+ return handlerID
2056 }2082 }
2057 2083
2058 fcb := func(clsPtr uintptr, LocationVarp uintptr, PaintableVarp uintptr) {2084 fcb := func(clsPtr uintptr, LocationVarp uintptr, PaintableVarp uintptr) {
@@ -2065,7 +2091,9 @@ func (x *TextBuffer) ConnectInsertPaintable(cb *func(TextBuffer, uintptr, uintpt
2065 }2091 }
2066 cbRefPtr := purego.NewCallback(fcb)2092 cbRefPtr := purego.NewCallback(fcb)
2067 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2093 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2068- return gobject.SignalConnect(x.GoPointer(), "insert-paintable", cbRefPtr)2094+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-paintable", cbRefPtr)
2095+ glib.SaveHandlerMapping(handlerID, cbPtr)
2096+ return handlerID
2069 }2097 }
2070 2098
2071 // Emitted to insert text in a `GtkTextBuffer`.2099 // Emitted to insert text in a `GtkTextBuffer`.
@@ -2079,10 +2107,12 @@ func (x *TextBuffer) ConnectInsertPaintable(cb *func(TextBuffer, uintptr, uintpt
2079 //2107 //
2080 // See also: [method@Gtk.TextBuffer.insert],2108 // See also: [method@Gtk.TextBuffer.insert],
2081 // [method@Gtk.TextBuffer.insert_range].2109 // [method@Gtk.TextBuffer.insert_range].
2082-func (x *TextBuffer) ConnectInsertText(cb *func(TextBuffer, uintptr, string, int)) uint32 {2110+func (x *TextBuffer) ConnectInsertText(cb *func(TextBuffer, uintptr, string, int)) uint {
2083 cbPtr := uintptr(unsafe.Pointer(cb))2111 cbPtr := uintptr(unsafe.Pointer(cb))
2084 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2112 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2085- return gobject.SignalConnect(x.GoPointer(), "insert-text", cbRefPtr)2113+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-text", cbRefPtr)
2114+ glib.SaveHandlerMapping(handlerID, cbPtr)
2115+ return handlerID
2086 }2116 }
2087 2117
2088 fcb := func(clsPtr uintptr, LocationVarp uintptr, TextVarp string, LenVarp int) {2118 fcb := func(clsPtr uintptr, LocationVarp uintptr, TextVarp string, LenVarp int) {
@@ -2095,16 +2125,20 @@ func (x *TextBuffer) ConnectInsertText(cb *func(TextBuffer, uintptr, string, int
2095 }2125 }
2096 cbRefPtr := purego.NewCallback(fcb)2126 cbRefPtr := purego.NewCallback(fcb)
2097 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2127 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2098- return gobject.SignalConnect(x.GoPointer(), "insert-text", cbRefPtr)2128+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-text", cbRefPtr)
2129+ glib.SaveHandlerMapping(handlerID, cbPtr)
2130+ return handlerID
2099 }2131 }
2100 2132
2101 // Emitted as notification after a `GtkTextMark` is deleted.2133 // Emitted as notification after a `GtkTextMark` is deleted.
2102 //2134 //
2103 // See also: [method@Gtk.TextBuffer.delete_mark].2135 // See also: [method@Gtk.TextBuffer.delete_mark].
2104-func (x *TextBuffer) ConnectMarkDeleted(cb *func(TextBuffer, uintptr)) uint32 {2136+func (x *TextBuffer) ConnectMarkDeleted(cb *func(TextBuffer, uintptr)) uint {
2105 cbPtr := uintptr(unsafe.Pointer(cb))2137 cbPtr := uintptr(unsafe.Pointer(cb))
2106 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2138 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2107- return gobject.SignalConnect(x.GoPointer(), "mark-deleted", cbRefPtr)2139+ handlerID := gobject.SignalConnect(x.GoPointer(), "mark-deleted", cbRefPtr)
2140+ glib.SaveHandlerMapping(handlerID, cbPtr)
2141+ return handlerID
2108 }2142 }
2109 2143
2110 fcb := func(clsPtr uintptr, MarkVarp uintptr) {2144 fcb := func(clsPtr uintptr, MarkVarp uintptr) {
@@ -2117,7 +2151,9 @@ func (x *TextBuffer) ConnectMarkDeleted(cb *func(TextBuffer, uintptr)) uint32 {
2117 }2151 }
2118 cbRefPtr := purego.NewCallback(fcb)2152 cbRefPtr := purego.NewCallback(fcb)
2119 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2153 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2120- return gobject.SignalConnect(x.GoPointer(), "mark-deleted", cbRefPtr)2154+ handlerID := gobject.SignalConnect(x.GoPointer(), "mark-deleted", cbRefPtr)
2155+ glib.SaveHandlerMapping(handlerID, cbPtr)
2156+ return handlerID
2121 }2157 }
2122 2158
2123 // Emitted as notification after a `GtkTextMark` is set.2159 // Emitted as notification after a `GtkTextMark` is set.
@@ -2125,10 +2161,12 @@ func (x *TextBuffer) ConnectMarkDeleted(cb *func(TextBuffer, uintptr)) uint32 {
2125 // See also:2161 // See also:
2126 // [method@Gtk.TextBuffer.create_mark],2162 // [method@Gtk.TextBuffer.create_mark],
2127 // [method@Gtk.TextBuffer.move_mark].2163 // [method@Gtk.TextBuffer.move_mark].
2128-func (x *TextBuffer) ConnectMarkSet(cb *func(TextBuffer, uintptr, uintptr)) uint32 {2164+func (x *TextBuffer) ConnectMarkSet(cb *func(TextBuffer, uintptr, uintptr)) uint {
2129 cbPtr := uintptr(unsafe.Pointer(cb))2165 cbPtr := uintptr(unsafe.Pointer(cb))
2130 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2166 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2131- return gobject.SignalConnect(x.GoPointer(), "mark-set", cbRefPtr)2167+ handlerID := gobject.SignalConnect(x.GoPointer(), "mark-set", cbRefPtr)
2168+ glib.SaveHandlerMapping(handlerID, cbPtr)
2169+ return handlerID
2132 }2170 }
2133 2171
2134 fcb := func(clsPtr uintptr, LocationVarp uintptr, MarkVarp uintptr) {2172 fcb := func(clsPtr uintptr, LocationVarp uintptr, MarkVarp uintptr) {
@@ -2141,16 +2179,20 @@ func (x *TextBuffer) ConnectMarkSet(cb *func(TextBuffer, uintptr, uintptr)) uint
2141 }2179 }
2142 cbRefPtr := purego.NewCallback(fcb)2180 cbRefPtr := purego.NewCallback(fcb)
2143 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2181 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2144- return gobject.SignalConnect(x.GoPointer(), "mark-set", cbRefPtr)2182+ handlerID := gobject.SignalConnect(x.GoPointer(), "mark-set", cbRefPtr)
2183+ glib.SaveHandlerMapping(handlerID, cbPtr)
2184+ return handlerID
2145 }2185 }
2146 2186
2147 // Emitted when the modified bit of a `GtkTextBuffer` flips.2187 // Emitted when the modified bit of a `GtkTextBuffer` flips.
2148 //2188 //
2149 // See also: [method@Gtk.TextBuffer.set_modified].2189 // See also: [method@Gtk.TextBuffer.set_modified].
2150-func (x *TextBuffer) ConnectModifiedChanged(cb *func(TextBuffer)) uint32 {2190+func (x *TextBuffer) ConnectModifiedChanged(cb *func(TextBuffer)) uint {
2151 cbPtr := uintptr(unsafe.Pointer(cb))2191 cbPtr := uintptr(unsafe.Pointer(cb))
2152 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2192 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2153- return gobject.SignalConnect(x.GoPointer(), "modified-changed", cbRefPtr)2193+ handlerID := gobject.SignalConnect(x.GoPointer(), "modified-changed", cbRefPtr)
2194+ glib.SaveHandlerMapping(handlerID, cbPtr)
2195+ return handlerID
2154 }2196 }
2155 2197
2156 fcb := func(clsPtr uintptr) {2198 fcb := func(clsPtr uintptr) {
@@ -2163,7 +2205,9 @@ func (x *TextBuffer) ConnectModifiedChanged(cb *func(TextBuffer)) uint32 {
2163 }2205 }
2164 cbRefPtr := purego.NewCallback(fcb)2206 cbRefPtr := purego.NewCallback(fcb)
2165 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2207 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2166- return gobject.SignalConnect(x.GoPointer(), "modified-changed", cbRefPtr)2208+ handlerID := gobject.SignalConnect(x.GoPointer(), "modified-changed", cbRefPtr)
2209+ glib.SaveHandlerMapping(handlerID, cbPtr)
2210+ return handlerID
2167 }2211 }
2168 2212
2169 // Emitted after paste operation has been completed.2213 // Emitted after paste operation has been completed.
@@ -2171,10 +2215,12 @@ func (x *TextBuffer) ConnectModifiedChanged(cb *func(TextBuffer)) uint32 {
2171 // This is useful to properly scroll the view to the end2215 // This is useful to properly scroll the view to the end
2172 // of the pasted text. See [method@Gtk.TextBuffer.paste_clipboard]2216 // of the pasted text. See [method@Gtk.TextBuffer.paste_clipboard]
2173 // for more details.2217 // for more details.
2174-func (x *TextBuffer) ConnectPasteDone(cb *func(TextBuffer, uintptr)) uint32 {2218+func (x *TextBuffer) ConnectPasteDone(cb *func(TextBuffer, uintptr)) uint {
2175 cbPtr := uintptr(unsafe.Pointer(cb))2219 cbPtr := uintptr(unsafe.Pointer(cb))
2176 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2220 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2177- return gobject.SignalConnect(x.GoPointer(), "paste-done", cbRefPtr)2221+ handlerID := gobject.SignalConnect(x.GoPointer(), "paste-done", cbRefPtr)
2222+ glib.SaveHandlerMapping(handlerID, cbPtr)
2223+ return handlerID
2178 }2224 }
2179 2225
2180 fcb := func(clsPtr uintptr, ClipboardVarp uintptr) {2226 fcb := func(clsPtr uintptr, ClipboardVarp uintptr) {
@@ -2187,15 +2233,19 @@ func (x *TextBuffer) ConnectPasteDone(cb *func(TextBuffer, uintptr)) uint32 {
2187 }2233 }
2188 cbRefPtr := purego.NewCallback(fcb)2234 cbRefPtr := purego.NewCallback(fcb)
2189 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2235 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2190- return gobject.SignalConnect(x.GoPointer(), "paste-done", cbRefPtr)2236+ handlerID := gobject.SignalConnect(x.GoPointer(), "paste-done", cbRefPtr)
2237+ glib.SaveHandlerMapping(handlerID, cbPtr)
2238+ return handlerID
2191 }2239 }
2192 2240
2193 // Emitted when a request has been made to redo the2241 // Emitted when a request has been made to redo the
2194 // previously undone operation.2242 // previously undone operation.
2195-func (x *TextBuffer) ConnectRedo(cb *func(TextBuffer)) uint32 {2243+func (x *TextBuffer) ConnectRedo(cb *func(TextBuffer)) uint {
2196 cbPtr := uintptr(unsafe.Pointer(cb))2244 cbPtr := uintptr(unsafe.Pointer(cb))
2197 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2245 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2198- return gobject.SignalConnect(x.GoPointer(), "redo", cbRefPtr)2246+ handlerID := gobject.SignalConnect(x.GoPointer(), "redo", cbRefPtr)
2247+ glib.SaveHandlerMapping(handlerID, cbPtr)
2248+ return handlerID
2199 }2249 }
2200 2250
2201 fcb := func(clsPtr uintptr) {2251 fcb := func(clsPtr uintptr) {
@@ -2208,7 +2258,9 @@ func (x *TextBuffer) ConnectRedo(cb *func(TextBuffer)) uint32 {
2208 }2258 }
2209 cbRefPtr := purego.NewCallback(fcb)2259 cbRefPtr := purego.NewCallback(fcb)
2210 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2260 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2211- return gobject.SignalConnect(x.GoPointer(), "redo", cbRefPtr)2261+ handlerID := gobject.SignalConnect(x.GoPointer(), "redo", cbRefPtr)
2262+ glib.SaveHandlerMapping(handlerID, cbPtr)
2263+ return handlerID
2212 }2264 }
2213 2265
2214 // Emitted to remove all occurrences of @tag from a range2266 // Emitted to remove all occurrences of @tag from a range
@@ -2221,10 +2273,12 @@ func (x *TextBuffer) ConnectRedo(cb *func(TextBuffer)) uint32 {
2221 // to revalidate them).2273 // to revalidate them).
2222 //2274 //
2223 // See also: [method@Gtk.TextBuffer.remove_tag].2275 // See also: [method@Gtk.TextBuffer.remove_tag].
2224-func (x *TextBuffer) ConnectRemoveTag(cb *func(TextBuffer, uintptr, uintptr, uintptr)) uint32 {2276+func (x *TextBuffer) ConnectRemoveTag(cb *func(TextBuffer, uintptr, uintptr, uintptr)) uint {
2225 cbPtr := uintptr(unsafe.Pointer(cb))2277 cbPtr := uintptr(unsafe.Pointer(cb))
2226 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2278 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2227- return gobject.SignalConnect(x.GoPointer(), "remove-tag", cbRefPtr)2279+ handlerID := gobject.SignalConnect(x.GoPointer(), "remove-tag", cbRefPtr)
2280+ glib.SaveHandlerMapping(handlerID, cbPtr)
2281+ return handlerID
2228 }2282 }
2229 2283
2230 fcb := func(clsPtr uintptr, TagVarp uintptr, StartVarp uintptr, EndVarp uintptr) {2284 fcb := func(clsPtr uintptr, TagVarp uintptr, StartVarp uintptr, EndVarp uintptr) {
@@ -2237,16 +2291,20 @@ func (x *TextBuffer) ConnectRemoveTag(cb *func(TextBuffer, uintptr, uintptr, uin
2237 }2291 }
2238 cbRefPtr := purego.NewCallback(fcb)2292 cbRefPtr := purego.NewCallback(fcb)
2239 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2293 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2240- return gobject.SignalConnect(x.GoPointer(), "remove-tag", cbRefPtr)2294+ handlerID := gobject.SignalConnect(x.GoPointer(), "remove-tag", cbRefPtr)
2295+ glib.SaveHandlerMapping(handlerID, cbPtr)
2296+ return handlerID
2241 }2297 }
2242 2298
2243 // Emitted when a request has been made to undo the2299 // Emitted when a request has been made to undo the
2244 // previous operation or set of operations that have2300 // previous operation or set of operations that have
2245 // been grouped together.2301 // been grouped together.
2246-func (x *TextBuffer) ConnectUndo(cb *func(TextBuffer)) uint32 {2302+func (x *TextBuffer) ConnectUndo(cb *func(TextBuffer)) uint {
2247 cbPtr := uintptr(unsafe.Pointer(cb))2303 cbPtr := uintptr(unsafe.Pointer(cb))
2248 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2304 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2249- return gobject.SignalConnect(x.GoPointer(), "undo", cbRefPtr)2305+ handlerID := gobject.SignalConnect(x.GoPointer(), "undo", cbRefPtr)
2306+ glib.SaveHandlerMapping(handlerID, cbPtr)
2307+ return handlerID
2250 }2308 }
2251 2309
2252 fcb := func(clsPtr uintptr) {2310 fcb := func(clsPtr uintptr) {
@@ -2259,7 +2317,9 @@ func (x *TextBuffer) ConnectUndo(cb *func(TextBuffer)) uint32 {
2259 }2317 }
2260 cbRefPtr := purego.NewCallback(fcb)2318 cbRefPtr := purego.NewCallback(fcb)
2261 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2319 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2262- return gobject.SignalConnect(x.GoPointer(), "undo", cbRefPtr)2320+ handlerID := gobject.SignalConnect(x.GoPointer(), "undo", cbRefPtr)
2321+ glib.SaveHandlerMapping(handlerID, cbPtr)
2322+ return handlerID
2263 }2323 }
2264 2324
2265 func init() {2325 func init() {
M v4/gtk/gtktexttagtable.go +21 -9
@@ -167,10 +167,12 @@ func (c *TextTagTable) SetGoPointer(ptr uintptr) {
167 }167 }
168 168
169 // Emitted every time a new tag is added in the `GtkTextTagTable`.169 // Emitted every time a new tag is added in the `GtkTextTagTable`.
170-func (x *TextTagTable) ConnectTagAdded(cb *func(TextTagTable, uintptr)) uint32 {170+func (x *TextTagTable) ConnectTagAdded(cb *func(TextTagTable, uintptr)) uint {
171 cbPtr := uintptr(unsafe.Pointer(cb))171 cbPtr := uintptr(unsafe.Pointer(cb))
172 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {172 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
173- return gobject.SignalConnect(x.GoPointer(), "tag-added", cbRefPtr)173+ handlerID := gobject.SignalConnect(x.GoPointer(), "tag-added", cbRefPtr)
174+ glib.SaveHandlerMapping(handlerID, cbPtr)
175+ return handlerID
174 }176 }
175 177
176 fcb := func(clsPtr uintptr, TagVarp uintptr) {178 fcb := func(clsPtr uintptr, TagVarp uintptr) {
@@ -183,14 +185,18 @@ func (x *TextTagTable) ConnectTagAdded(cb *func(TextTagTable, uintptr)) uint32 {
183 }185 }
184 cbRefPtr := purego.NewCallback(fcb)186 cbRefPtr := purego.NewCallback(fcb)
185 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)187 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
186- return gobject.SignalConnect(x.GoPointer(), "tag-added", cbRefPtr)188+ handlerID := gobject.SignalConnect(x.GoPointer(), "tag-added", cbRefPtr)
189+ glib.SaveHandlerMapping(handlerID, cbPtr)
190+ return handlerID
187 }191 }
188 192
189 // Emitted every time a tag in the `GtkTextTagTable` changes.193 // Emitted every time a tag in the `GtkTextTagTable` changes.
190-func (x *TextTagTable) ConnectTagChanged(cb *func(TextTagTable, uintptr, bool)) uint32 {194+func (x *TextTagTable) ConnectTagChanged(cb *func(TextTagTable, uintptr, bool)) uint {
191 cbPtr := uintptr(unsafe.Pointer(cb))195 cbPtr := uintptr(unsafe.Pointer(cb))
192 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {196 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
193- return gobject.SignalConnect(x.GoPointer(), "tag-changed", cbRefPtr)197+ handlerID := gobject.SignalConnect(x.GoPointer(), "tag-changed", cbRefPtr)
198+ glib.SaveHandlerMapping(handlerID, cbPtr)
199+ return handlerID
194 }200 }
195 201
196 fcb := func(clsPtr uintptr, TagVarp uintptr, SizeChangedVarp bool) {202 fcb := func(clsPtr uintptr, TagVarp uintptr, SizeChangedVarp bool) {
@@ -203,17 +209,21 @@ func (x *TextTagTable) ConnectTagChanged(cb *func(TextTagTable, uintptr, bool))
203 }209 }
204 cbRefPtr := purego.NewCallback(fcb)210 cbRefPtr := purego.NewCallback(fcb)
205 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)211 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
206- return gobject.SignalConnect(x.GoPointer(), "tag-changed", cbRefPtr)212+ handlerID := gobject.SignalConnect(x.GoPointer(), "tag-changed", cbRefPtr)
213+ glib.SaveHandlerMapping(handlerID, cbPtr)
214+ return handlerID
207 }215 }
208 216
209 // Emitted every time a tag is removed from the `GtkTextTagTable`.217 // Emitted every time a tag is removed from the `GtkTextTagTable`.
210 //218 //
211 // The @tag is still valid by the time the signal is emitted, but219 // The @tag is still valid by the time the signal is emitted, but
212 // it is not associated with a tag table any more.220 // it is not associated with a tag table any more.
213-func (x *TextTagTable) ConnectTagRemoved(cb *func(TextTagTable, uintptr)) uint32 {221+func (x *TextTagTable) ConnectTagRemoved(cb *func(TextTagTable, uintptr)) uint {
214 cbPtr := uintptr(unsafe.Pointer(cb))222 cbPtr := uintptr(unsafe.Pointer(cb))
215 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {223 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
216- return gobject.SignalConnect(x.GoPointer(), "tag-removed", cbRefPtr)224+ handlerID := gobject.SignalConnect(x.GoPointer(), "tag-removed", cbRefPtr)
225+ glib.SaveHandlerMapping(handlerID, cbPtr)
226+ return handlerID
217 }227 }
218 228
219 fcb := func(clsPtr uintptr, TagVarp uintptr) {229 fcb := func(clsPtr uintptr, TagVarp uintptr) {
@@ -226,7 +236,9 @@ func (x *TextTagTable) ConnectTagRemoved(cb *func(TextTagTable, uintptr)) uint32
226 }236 }
227 cbRefPtr := purego.NewCallback(fcb)237 cbRefPtr := purego.NewCallback(fcb)
228 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)238 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
229- return gobject.SignalConnect(x.GoPointer(), "tag-removed", cbRefPtr)239+ handlerID := gobject.SignalConnect(x.GoPointer(), "tag-removed", cbRefPtr)
240+ glib.SaveHandlerMapping(handlerID, cbPtr)
241+ return handlerID
230 }242 }
231 243
232 // Gets the ID of the @buildable object.244 // Gets the ID of the @buildable object.
M v4/gtk/gtktextview.go +105 -45
@@ -2003,10 +2003,12 @@ func (x *TextView) GetPropertyTopMargin() int {
2003 //2003 //
2004 // The default bindings for this signal are2004 // The default bindings for this signal are
2005 // &lt;kbd&gt;Backspace&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt;.2005 // &lt;kbd&gt;Backspace&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt;.
2006-func (x *TextView) ConnectBackspace(cb *func(TextView)) uint32 {2006+func (x *TextView) ConnectBackspace(cb *func(TextView)) uint {
2007 cbPtr := uintptr(unsafe.Pointer(cb))2007 cbPtr := uintptr(unsafe.Pointer(cb))
2008 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2008 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2009- return gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)2009+ handlerID := gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)
2010+ glib.SaveHandlerMapping(handlerID, cbPtr)
2011+ return handlerID
2010 }2012 }
2011 2013
2012 fcb := func(clsPtr uintptr) {2014 fcb := func(clsPtr uintptr) {
@@ -2019,7 +2021,9 @@ func (x *TextView) ConnectBackspace(cb *func(TextView)) uint32 {
2019 }2021 }
2020 cbRefPtr := purego.NewCallback(fcb)2022 cbRefPtr := purego.NewCallback(fcb)
2021 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2023 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2022- return gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)2024+ handlerID := gobject.SignalConnect(x.GoPointer(), "backspace", cbRefPtr)
2025+ glib.SaveHandlerMapping(handlerID, cbPtr)
2026+ return handlerID
2023 }2027 }
2024 2028
2025 // Gets emitted to copy the selection to the clipboard.2029 // Gets emitted to copy the selection to the clipboard.
@@ -2029,10 +2033,12 @@ func (x *TextView) ConnectBackspace(cb *func(TextView)) uint32 {
2029 // The default bindings for this signal are2033 // The default bindings for this signal are
2030 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; and2034 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; and
2031 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.2035 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.
2032-func (x *TextView) ConnectCopyClipboard(cb *func(TextView)) uint32 {2036+func (x *TextView) ConnectCopyClipboard(cb *func(TextView)) uint {
2033 cbPtr := uintptr(unsafe.Pointer(cb))2037 cbPtr := uintptr(unsafe.Pointer(cb))
2034 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2038 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2035- return gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)2039+ handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
2040+ glib.SaveHandlerMapping(handlerID, cbPtr)
2041+ return handlerID
2036 }2042 }
2037 2043
2038 fcb := func(clsPtr uintptr) {2044 fcb := func(clsPtr uintptr) {
@@ -2045,7 +2051,9 @@ func (x *TextView) ConnectCopyClipboard(cb *func(TextView)) uint32 {
2045 }2051 }
2046 cbRefPtr := purego.NewCallback(fcb)2052 cbRefPtr := purego.NewCallback(fcb)
2047 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2053 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2048- return gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)2054+ handlerID := gobject.SignalConnect(x.GoPointer(), "copy-clipboard", cbRefPtr)
2055+ glib.SaveHandlerMapping(handlerID, cbPtr)
2056+ return handlerID
2049 }2057 }
2050 2058
2051 // Gets emitted to cut the selection to the clipboard.2059 // Gets emitted to cut the selection to the clipboard.
@@ -2055,10 +2063,12 @@ func (x *TextView) ConnectCopyClipboard(cb *func(TextView)) uint32 {
2055 // The default bindings for this signal are2063 // The default bindings for this signal are
2056 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt; and2064 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt; and
2057 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt;.2065 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt;.
2058-func (x *TextView) ConnectCutClipboard(cb *func(TextView)) uint32 {2066+func (x *TextView) ConnectCutClipboard(cb *func(TextView)) uint {
2059 cbPtr := uintptr(unsafe.Pointer(cb))2067 cbPtr := uintptr(unsafe.Pointer(cb))
2060 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2068 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2061- return gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)2069+ handlerID := gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)
2070+ glib.SaveHandlerMapping(handlerID, cbPtr)
2071+ return handlerID
2062 }2072 }
2063 2073
2064 fcb := func(clsPtr uintptr) {2074 fcb := func(clsPtr uintptr) {
@@ -2071,7 +2081,9 @@ func (x *TextView) ConnectCutClipboard(cb *func(TextView)) uint32 {
2071 }2081 }
2072 cbRefPtr := purego.NewCallback(fcb)2082 cbRefPtr := purego.NewCallback(fcb)
2073 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2083 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2074- return gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)2084+ handlerID := gobject.SignalConnect(x.GoPointer(), "cut-clipboard", cbRefPtr)
2085+ glib.SaveHandlerMapping(handlerID, cbPtr)
2086+ return handlerID
2075 }2087 }
2076 2088
2077 // Gets emitted when the user initiates a text deletion.2089 // Gets emitted when the user initiates a text deletion.
@@ -2086,10 +2098,12 @@ func (x *TextView) ConnectCutClipboard(cb *func(TextView)) uint32 {
2086 // deleting a character, &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt; for2098 // deleting a character, &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Delete&lt;/kbd&gt; for
2087 // deleting a word and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt; for2099 // deleting a word and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt; for
2088 // deleting a word backwards.2100 // deleting a word backwards.
2089-func (x *TextView) ConnectDeleteFromCursor(cb *func(TextView, DeleteType, int)) uint32 {2101+func (x *TextView) ConnectDeleteFromCursor(cb *func(TextView, DeleteType, int)) uint {
2090 cbPtr := uintptr(unsafe.Pointer(cb))2102 cbPtr := uintptr(unsafe.Pointer(cb))
2091 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2103 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2092- return gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)2104+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)
2105+ glib.SaveHandlerMapping(handlerID, cbPtr)
2106+ return handlerID
2093 }2107 }
2094 2108
2095 fcb := func(clsPtr uintptr, TypeVarp DeleteType, CountVarp int) {2109 fcb := func(clsPtr uintptr, TypeVarp DeleteType, CountVarp int) {
@@ -2102,14 +2116,18 @@ func (x *TextView) ConnectDeleteFromCursor(cb *func(TextView, DeleteType, int))
2102 }2116 }
2103 cbRefPtr := purego.NewCallback(fcb)2117 cbRefPtr := purego.NewCallback(fcb)
2104 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2118 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2105- return gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)2119+ handlerID := gobject.SignalConnect(x.GoPointer(), "delete-from-cursor", cbRefPtr)
2120+ glib.SaveHandlerMapping(handlerID, cbPtr)
2121+ return handlerID
2106 }2122 }
2107 2123
2108 // Emitted when the selection needs to be extended at @location.2124 // Emitted when the selection needs to be extended at @location.
2109-func (x *TextView) ConnectExtendSelection(cb *func(TextView, TextExtendSelection, uintptr, uintptr, uintptr) bool) uint32 {2125+func (x *TextView) ConnectExtendSelection(cb *func(TextView, TextExtendSelection, uintptr, uintptr, uintptr) bool) uint {
2110 cbPtr := uintptr(unsafe.Pointer(cb))2126 cbPtr := uintptr(unsafe.Pointer(cb))
2111 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2127 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2112- return gobject.SignalConnect(x.GoPointer(), "extend-selection", cbRefPtr)2128+ handlerID := gobject.SignalConnect(x.GoPointer(), "extend-selection", cbRefPtr)
2129+ glib.SaveHandlerMapping(handlerID, cbPtr)
2130+ return handlerID
2113 }2131 }
2114 2132
2115 fcb := func(clsPtr uintptr, GranularityVarp TextExtendSelection, LocationVarp uintptr, StartVarp uintptr, EndVarp uintptr) bool {2133 fcb := func(clsPtr uintptr, GranularityVarp TextExtendSelection, LocationVarp uintptr, StartVarp uintptr, EndVarp uintptr) bool {
@@ -2122,7 +2140,9 @@ func (x *TextView) ConnectExtendSelection(cb *func(TextView, TextExtendSelection
2122 }2140 }
2123 cbRefPtr := purego.NewCallback(fcb)2141 cbRefPtr := purego.NewCallback(fcb)
2124 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2142 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2125- return gobject.SignalConnect(x.GoPointer(), "extend-selection", cbRefPtr)2143+ handlerID := gobject.SignalConnect(x.GoPointer(), "extend-selection", cbRefPtr)
2144+ glib.SaveHandlerMapping(handlerID, cbPtr)
2145+ return handlerID
2126 }2146 }
2127 2147
2128 // Gets emitted when the user initiates the insertion of a2148 // Gets emitted when the user initiates the insertion of a
@@ -2131,10 +2151,12 @@ func (x *TextView) ConnectExtendSelection(cb *func(TextView, TextExtendSelection
2131 // The ::insert-at-cursor signal is a [keybinding signal](class.SignalAction.html).2151 // The ::insert-at-cursor signal is a [keybinding signal](class.SignalAction.html).
2132 //2152 //
2133 // This signal has no default bindings.2153 // This signal has no default bindings.
2134-func (x *TextView) ConnectInsertAtCursor(cb *func(TextView, string)) uint32 {2154+func (x *TextView) ConnectInsertAtCursor(cb *func(TextView, string)) uint {
2135 cbPtr := uintptr(unsafe.Pointer(cb))2155 cbPtr := uintptr(unsafe.Pointer(cb))
2136 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2156 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2137- return gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)2157+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)
2158+ glib.SaveHandlerMapping(handlerID, cbPtr)
2159+ return handlerID
2138 }2160 }
2139 2161
2140 fcb := func(clsPtr uintptr, StringVarp string) {2162 fcb := func(clsPtr uintptr, StringVarp string) {
@@ -2147,7 +2169,9 @@ func (x *TextView) ConnectInsertAtCursor(cb *func(TextView, string)) uint32 {
2147 }2169 }
2148 cbRefPtr := purego.NewCallback(fcb)2170 cbRefPtr := purego.NewCallback(fcb)
2149 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2171 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2150- return gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)2172+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-at-cursor", cbRefPtr)
2173+ glib.SaveHandlerMapping(handlerID, cbPtr)
2174+ return handlerID
2151 }2175 }
2152 2176
2153 // Gets emitted to present the Emoji chooser for the @text_view.2177 // Gets emitted to present the Emoji chooser for the @text_view.
@@ -2157,10 +2181,12 @@ func (x *TextView) ConnectInsertAtCursor(cb *func(TextView, string)) uint32 {
2157 // The default bindings for this signal are2181 // The default bindings for this signal are
2158 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;.&lt;/kbd&gt; and2182 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;.&lt;/kbd&gt; and
2159 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;;&lt;/kbd&gt;2183 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;;&lt;/kbd&gt;
2160-func (x *TextView) ConnectInsertEmoji(cb *func(TextView)) uint32 {2184+func (x *TextView) ConnectInsertEmoji(cb *func(TextView)) uint {
2161 cbPtr := uintptr(unsafe.Pointer(cb))2185 cbPtr := uintptr(unsafe.Pointer(cb))
2162 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2186 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2163- return gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)2187+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)
2188+ glib.SaveHandlerMapping(handlerID, cbPtr)
2189+ return handlerID
2164 }2190 }
2165 2191
2166 fcb := func(clsPtr uintptr) {2192 fcb := func(clsPtr uintptr) {
@@ -2173,7 +2199,9 @@ func (x *TextView) ConnectInsertEmoji(cb *func(TextView)) uint32 {
2173 }2199 }
2174 cbRefPtr := purego.NewCallback(fcb)2200 cbRefPtr := purego.NewCallback(fcb)
2175 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2201 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2176- return gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)2202+ handlerID := gobject.SignalConnect(x.GoPointer(), "insert-emoji", cbRefPtr)
2203+ glib.SaveHandlerMapping(handlerID, cbPtr)
2204+ return handlerID
2177 }2205 }
2178 2206
2179 // Gets emitted when the user initiates a cursor movement.2207 // Gets emitted when the user initiates a cursor movement.
@@ -2198,10 +2226,12 @@ func (x *TextView) ConnectInsertEmoji(cb *func(TextView)) uint32 {
2198 // - &lt;kbd&gt;PgUp&lt;/kbd&gt; and &lt;kbd&gt;PgDn&lt;/kbd&gt; move vertically by pages2226 // - &lt;kbd&gt;PgUp&lt;/kbd&gt; and &lt;kbd&gt;PgDn&lt;/kbd&gt; move vertically by pages
2199 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;2227 // - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgUp&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;PgDn&lt;/kbd&gt;
2200 // move horizontally by pages2228 // move horizontally by pages
2201-func (x *TextView) ConnectMoveCursor(cb *func(TextView, MovementStep, int, bool)) uint32 {2229+func (x *TextView) ConnectMoveCursor(cb *func(TextView, MovementStep, int, bool)) uint {
2202 cbPtr := uintptr(unsafe.Pointer(cb))2230 cbPtr := uintptr(unsafe.Pointer(cb))
2203 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2231 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2204- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)2232+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
2233+ glib.SaveHandlerMapping(handlerID, cbPtr)
2234+ return handlerID
2205 }2235 }
2206 2236
2207 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool) {2237 fcb := func(clsPtr uintptr, StepVarp MovementStep, CountVarp int, ExtendSelectionVarp bool) {
@@ -2214,7 +2244,9 @@ func (x *TextView) ConnectMoveCursor(cb *func(TextView, MovementStep, int, bool)
2214 }2244 }
2215 cbRefPtr := purego.NewCallback(fcb)2245 cbRefPtr := purego.NewCallback(fcb)
2216 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2246 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2217- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)2247+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
2248+ glib.SaveHandlerMapping(handlerID, cbPtr)
2249+ return handlerID
2218 }2250 }
2219 2251
2220 // Gets emitted to move the viewport.2252 // Gets emitted to move the viewport.
@@ -2225,10 +2257,12 @@ func (x *TextView) ConnectMoveCursor(cb *func(TextView, MovementStep, int, bool)
2225 // window.2257 // window.
2226 //2258 //
2227 // There are no default bindings for this signal.2259 // There are no default bindings for this signal.
2228-func (x *TextView) ConnectMoveViewport(cb *func(TextView, ScrollStep, int)) uint32 {2260+func (x *TextView) ConnectMoveViewport(cb *func(TextView, ScrollStep, int)) uint {
2229 cbPtr := uintptr(unsafe.Pointer(cb))2261 cbPtr := uintptr(unsafe.Pointer(cb))
2230 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2262 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2231- return gobject.SignalConnect(x.GoPointer(), "move-viewport", cbRefPtr)2263+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-viewport", cbRefPtr)
2264+ glib.SaveHandlerMapping(handlerID, cbPtr)
2265+ return handlerID
2232 }2266 }
2233 2267
2234 fcb := func(clsPtr uintptr, StepVarp ScrollStep, CountVarp int) {2268 fcb := func(clsPtr uintptr, StepVarp ScrollStep, CountVarp int) {
@@ -2241,7 +2275,9 @@ func (x *TextView) ConnectMoveViewport(cb *func(TextView, ScrollStep, int)) uint
2241 }2275 }
2242 cbRefPtr := purego.NewCallback(fcb)2276 cbRefPtr := purego.NewCallback(fcb)
2243 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2277 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2244- return gobject.SignalConnect(x.GoPointer(), "move-viewport", cbRefPtr)2278+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-viewport", cbRefPtr)
2279+ glib.SaveHandlerMapping(handlerID, cbPtr)
2280+ return handlerID
2245 }2281 }
2246 2282
2247 // Gets emitted to paste the contents of the clipboard2283 // Gets emitted to paste the contents of the clipboard
@@ -2252,10 +2288,12 @@ func (x *TextView) ConnectMoveViewport(cb *func(TextView, ScrollStep, int)) uint
2252 // The default bindings for this signal are2288 // The default bindings for this signal are
2253 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;v&lt;/kbd&gt; and2289 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;v&lt;/kbd&gt; and
2254 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.2290 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Insert&lt;/kbd&gt;.
2255-func (x *TextView) ConnectPasteClipboard(cb *func(TextView)) uint32 {2291+func (x *TextView) ConnectPasteClipboard(cb *func(TextView)) uint {
2256 cbPtr := uintptr(unsafe.Pointer(cb))2292 cbPtr := uintptr(unsafe.Pointer(cb))
2257 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2293 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2258- return gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)2294+ handlerID := gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)
2295+ glib.SaveHandlerMapping(handlerID, cbPtr)
2296+ return handlerID
2259 }2297 }
2260 2298
2261 fcb := func(clsPtr uintptr) {2299 fcb := func(clsPtr uintptr) {
@@ -2268,7 +2306,9 @@ func (x *TextView) ConnectPasteClipboard(cb *func(TextView)) uint32 {
2268 }2306 }
2269 cbRefPtr := purego.NewCallback(fcb)2307 cbRefPtr := purego.NewCallback(fcb)
2270 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2308 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2271- return gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)2309+ handlerID := gobject.SignalConnect(x.GoPointer(), "paste-clipboard", cbRefPtr)
2310+ glib.SaveHandlerMapping(handlerID, cbPtr)
2311+ return handlerID
2272 }2312 }
2273 2313
2274 // Emitted when preedit text of the active IM changes.2314 // Emitted when preedit text of the active IM changes.
@@ -2279,10 +2319,12 @@ func (x *TextView) ConnectPasteClipboard(cb *func(TextView)) uint32 {
2279 //2319 //
2280 // This signal is only emitted if the text at the given position2320 // This signal is only emitted if the text at the given position
2281 // is actually editable.2321 // is actually editable.
2282-func (x *TextView) ConnectPreeditChanged(cb *func(TextView, string)) uint32 {2322+func (x *TextView) ConnectPreeditChanged(cb *func(TextView, string)) uint {
2283 cbPtr := uintptr(unsafe.Pointer(cb))2323 cbPtr := uintptr(unsafe.Pointer(cb))
2284 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2324 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2285- return gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)2325+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
2326+ glib.SaveHandlerMapping(handlerID, cbPtr)
2327+ return handlerID
2286 }2328 }
2287 2329
2288 fcb := func(clsPtr uintptr, PreeditVarp string) {2330 fcb := func(clsPtr uintptr, PreeditVarp string) {
@@ -2295,7 +2337,9 @@ func (x *TextView) ConnectPreeditChanged(cb *func(TextView, string)) uint32 {
2295 }2337 }
2296 cbRefPtr := purego.NewCallback(fcb)2338 cbRefPtr := purego.NewCallback(fcb)
2297 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2339 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2298- return gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)2340+ handlerID := gobject.SignalConnect(x.GoPointer(), "preedit-changed", cbRefPtr)
2341+ glib.SaveHandlerMapping(handlerID, cbPtr)
2342+ return handlerID
2299 }2343 }
2300 2344
2301 // Gets emitted to select or unselect the complete contents of the text view.2345 // Gets emitted to select or unselect the complete contents of the text view.
@@ -2307,10 +2351,12 @@ func (x *TextView) ConnectPreeditChanged(cb *func(TextView, string)) uint32 {
2307 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;/&lt;/kbd&gt; for selecting and2351 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;/&lt;/kbd&gt; for selecting and
2308 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;a&lt;/kbd&gt; and2352 // &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;a&lt;/kbd&gt; and
2309 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;\&lt;/kbd&gt; for unselecting.2353 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;\&lt;/kbd&gt; for unselecting.
2310-func (x *TextView) ConnectSelectAll(cb *func(TextView, bool)) uint32 {2354+func (x *TextView) ConnectSelectAll(cb *func(TextView, bool)) uint {
2311 cbPtr := uintptr(unsafe.Pointer(cb))2355 cbPtr := uintptr(unsafe.Pointer(cb))
2312 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2356 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2313- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)2357+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
2358+ glib.SaveHandlerMapping(handlerID, cbPtr)
2359+ return handlerID
2314 }2360 }
2315 2361
2316 fcb := func(clsPtr uintptr, SelectVarp bool) {2362 fcb := func(clsPtr uintptr, SelectVarp bool) {
@@ -2323,7 +2369,9 @@ func (x *TextView) ConnectSelectAll(cb *func(TextView, bool)) uint32 {
2323 }2369 }
2324 cbRefPtr := purego.NewCallback(fcb)2370 cbRefPtr := purego.NewCallback(fcb)
2325 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2371 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2326- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)2372+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
2373+ glib.SaveHandlerMapping(handlerID, cbPtr)
2374+ return handlerID
2327 }2375 }
2328 2376
2329 // Gets emitted when the user initiates settings the "anchor" mark.2377 // Gets emitted when the user initiates settings the "anchor" mark.
@@ -2334,10 +2382,12 @@ func (x *TextView) ConnectSelectAll(cb *func(TextView, bool)) uint32 {
2334 // "insert" mark.2382 // "insert" mark.
2335 //2383 //
2336 // This signal has no default bindings.2384 // This signal has no default bindings.
2337-func (x *TextView) ConnectSetAnchor(cb *func(TextView)) uint32 {2385+func (x *TextView) ConnectSetAnchor(cb *func(TextView)) uint {
2338 cbPtr := uintptr(unsafe.Pointer(cb))2386 cbPtr := uintptr(unsafe.Pointer(cb))
2339 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2387 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2340- return gobject.SignalConnect(x.GoPointer(), "set-anchor", cbRefPtr)2388+ handlerID := gobject.SignalConnect(x.GoPointer(), "set-anchor", cbRefPtr)
2389+ glib.SaveHandlerMapping(handlerID, cbPtr)
2390+ return handlerID
2341 }2391 }
2342 2392
2343 fcb := func(clsPtr uintptr) {2393 fcb := func(clsPtr uintptr) {
@@ -2350,7 +2400,9 @@ func (x *TextView) ConnectSetAnchor(cb *func(TextView)) uint32 {
2350 }2400 }
2351 cbRefPtr := purego.NewCallback(fcb)2401 cbRefPtr := purego.NewCallback(fcb)
2352 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2402 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2353- return gobject.SignalConnect(x.GoPointer(), "set-anchor", cbRefPtr)2403+ handlerID := gobject.SignalConnect(x.GoPointer(), "set-anchor", cbRefPtr)
2404+ glib.SaveHandlerMapping(handlerID, cbPtr)
2405+ return handlerID
2354 }2406 }
2355 2407
2356 // Gets emitted to toggle the `cursor-visible` property.2408 // Gets emitted to toggle the `cursor-visible` property.
@@ -2359,10 +2411,12 @@ func (x *TextView) ConnectSetAnchor(cb *func(TextView)) uint32 {
2359 // [keybinding signal](class.SignalAction.html).2411 // [keybinding signal](class.SignalAction.html).
2360 //2412 //
2361 // The default binding for this signal is &lt;kbd&gt;F7&lt;/kbd&gt;.2413 // The default binding for this signal is &lt;kbd&gt;F7&lt;/kbd&gt;.
2362-func (x *TextView) ConnectToggleCursorVisible(cb *func(TextView)) uint32 {2414+func (x *TextView) ConnectToggleCursorVisible(cb *func(TextView)) uint {
2363 cbPtr := uintptr(unsafe.Pointer(cb))2415 cbPtr := uintptr(unsafe.Pointer(cb))
2364 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2416 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2365- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-visible", cbRefPtr)2417+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-visible", cbRefPtr)
2418+ glib.SaveHandlerMapping(handlerID, cbPtr)
2419+ return handlerID
2366 }2420 }
2367 2421
2368 fcb := func(clsPtr uintptr) {2422 fcb := func(clsPtr uintptr) {
@@ -2375,7 +2429,9 @@ func (x *TextView) ConnectToggleCursorVisible(cb *func(TextView)) uint32 {
2375 }2429 }
2376 cbRefPtr := purego.NewCallback(fcb)2430 cbRefPtr := purego.NewCallback(fcb)
2377 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2431 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2378- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-visible", cbRefPtr)2432+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-visible", cbRefPtr)
2433+ glib.SaveHandlerMapping(handlerID, cbPtr)
2434+ return handlerID
2379 }2435 }
2380 2436
2381 // Gets emitted to toggle the overwrite mode of the text view.2437 // Gets emitted to toggle the overwrite mode of the text view.
@@ -2383,10 +2439,12 @@ func (x *TextView) ConnectToggleCursorVisible(cb *func(TextView)) uint32 {
2383 // The ::toggle-overwrite signal is a [keybinding signal](class.SignalAction.html).2439 // The ::toggle-overwrite signal is a [keybinding signal](class.SignalAction.html).
2384 //2440 //
2385 // The default binding for this signal is &lt;kbd&gt;Insert&lt;/kbd&gt;.2441 // The default binding for this signal is &lt;kbd&gt;Insert&lt;/kbd&gt;.
2386-func (x *TextView) ConnectToggleOverwrite(cb *func(TextView)) uint32 {2442+func (x *TextView) ConnectToggleOverwrite(cb *func(TextView)) uint {
2387 cbPtr := uintptr(unsafe.Pointer(cb))2443 cbPtr := uintptr(unsafe.Pointer(cb))
2388 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2444 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2389- return gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)2445+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)
2446+ glib.SaveHandlerMapping(handlerID, cbPtr)
2447+ return handlerID
2390 }2448 }
2391 2449
2392 fcb := func(clsPtr uintptr) {2450 fcb := func(clsPtr uintptr) {
@@ -2399,7 +2457,9 @@ func (x *TextView) ConnectToggleOverwrite(cb *func(TextView)) uint32 {
2399 }2457 }
2400 cbRefPtr := purego.NewCallback(fcb)2458 cbRefPtr := purego.NewCallback(fcb)
2401 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2459 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2402- return gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)2460+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-overwrite", cbRefPtr)
2461+ glib.SaveHandlerMapping(handlerID, cbPtr)
2462+ return handlerID
2403 }2463 }
2404 2464
2405 // Requests the user's screen reader to announce the given message.2465 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtktogglebutton.go +7 -3
@@ -289,10 +289,12 @@ func (x *ToggleButton) GetPropertyActive() bool {
289 }289 }
290 290
291 // Emitted whenever the `GtkToggleButton`'s state is changed.291 // Emitted whenever the `GtkToggleButton`'s state is changed.
292-func (x *ToggleButton) ConnectToggled(cb *func(ToggleButton)) uint32 {292+func (x *ToggleButton) ConnectToggled(cb *func(ToggleButton)) uint {
293 cbPtr := uintptr(unsafe.Pointer(cb))293 cbPtr := uintptr(unsafe.Pointer(cb))
294 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {294 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
295- return gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)295+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
296+ glib.SaveHandlerMapping(handlerID, cbPtr)
297+ return handlerID
296 }298 }
297 299
298 fcb := func(clsPtr uintptr) {300 fcb := func(clsPtr uintptr) {
@@ -305,7 +307,9 @@ func (x *ToggleButton) ConnectToggled(cb *func(ToggleButton)) uint32 {
305 }307 }
306 cbRefPtr := purego.NewCallback(fcb)308 cbRefPtr := purego.NewCallback(fcb)
307 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)309 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
308- return gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)310+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggled", cbRefPtr)
311+ glib.SaveHandlerMapping(handlerID, cbPtr)
312+ return handlerID
309 }313 }
310 314
311 // Requests the user's screen reader to announce the given message.315 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtktreeselection.go +7 -3
@@ -347,10 +347,12 @@ func (c *TreeSelection) SetGoPointer(ptr uintptr) {
347 // this signal is mostly a hint. It may only be emitted once when a range347 // this signal is mostly a hint. It may only be emitted once when a range
348 // of rows are selected, and it may occasionally be emitted when nothing348 // of rows are selected, and it may occasionally be emitted when nothing
349 // has happened.349 // has happened.
350-func (x *TreeSelection) ConnectChanged(cb *func(TreeSelection)) uint32 {350+func (x *TreeSelection) ConnectChanged(cb *func(TreeSelection)) uint {
351 cbPtr := uintptr(unsafe.Pointer(cb))351 cbPtr := uintptr(unsafe.Pointer(cb))
352 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {352 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
353- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)353+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
354+ glib.SaveHandlerMapping(handlerID, cbPtr)
355+ return handlerID
354 }356 }
355 357
356 fcb := func(clsPtr uintptr) {358 fcb := func(clsPtr uintptr) {
@@ -363,7 +365,9 @@ func (x *TreeSelection) ConnectChanged(cb *func(TreeSelection)) uint32 {
363 }365 }
364 cbRefPtr := purego.NewCallback(fcb)366 cbRefPtr := purego.NewCallback(fcb)
365 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)367 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
366- return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)368+ handlerID := gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr)
369+ glib.SaveHandlerMapping(handlerID, cbPtr)
370+ return handlerID
367 }371 }
368 372
369 func init() {373 func init() {
M v4/gtk/gtktreeview.go +105 -45
@@ -2123,10 +2123,12 @@ func (x *TreeView) GetPropertyTooltipColumn() int {
2123 }2123 }
2124 2124
2125 // The number of columns of the treeview has changed.2125 // The number of columns of the treeview has changed.
2126-func (x *TreeView) ConnectColumnsChanged(cb *func(TreeView)) uint32 {2126+func (x *TreeView) ConnectColumnsChanged(cb *func(TreeView)) uint {
2127 cbPtr := uintptr(unsafe.Pointer(cb))2127 cbPtr := uintptr(unsafe.Pointer(cb))
2128 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2128 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2129- return gobject.SignalConnect(x.GoPointer(), "columns-changed", cbRefPtr)2129+ handlerID := gobject.SignalConnect(x.GoPointer(), "columns-changed", cbRefPtr)
2130+ glib.SaveHandlerMapping(handlerID, cbPtr)
2131+ return handlerID
2130 }2132 }
2131 2133
2132 fcb := func(clsPtr uintptr) {2134 fcb := func(clsPtr uintptr) {
@@ -2139,14 +2141,18 @@ func (x *TreeView) ConnectColumnsChanged(cb *func(TreeView)) uint32 {
2139 }2141 }
2140 cbRefPtr := purego.NewCallback(fcb)2142 cbRefPtr := purego.NewCallback(fcb)
2141 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2143 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2142- return gobject.SignalConnect(x.GoPointer(), "columns-changed", cbRefPtr)2144+ handlerID := gobject.SignalConnect(x.GoPointer(), "columns-changed", cbRefPtr)
2145+ glib.SaveHandlerMapping(handlerID, cbPtr)
2146+ return handlerID
2143 }2147 }
2144 2148
2145 // The position of the cursor (focused cell) has changed.2149 // The position of the cursor (focused cell) has changed.
2146-func (x *TreeView) ConnectCursorChanged(cb *func(TreeView)) uint32 {2150+func (x *TreeView) ConnectCursorChanged(cb *func(TreeView)) uint {
2147 cbPtr := uintptr(unsafe.Pointer(cb))2151 cbPtr := uintptr(unsafe.Pointer(cb))
2148 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2152 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2149- return gobject.SignalConnect(x.GoPointer(), "cursor-changed", cbRefPtr)2153+ handlerID := gobject.SignalConnect(x.GoPointer(), "cursor-changed", cbRefPtr)
2154+ glib.SaveHandlerMapping(handlerID, cbPtr)
2155+ return handlerID
2150 }2156 }
2151 2157
2152 fcb := func(clsPtr uintptr) {2158 fcb := func(clsPtr uintptr) {
@@ -2159,13 +2165,17 @@ func (x *TreeView) ConnectCursorChanged(cb *func(TreeView)) uint32 {
2159 }2165 }
2160 cbRefPtr := purego.NewCallback(fcb)2166 cbRefPtr := purego.NewCallback(fcb)
2161 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2167 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2162- return gobject.SignalConnect(x.GoPointer(), "cursor-changed", cbRefPtr)2168+ handlerID := gobject.SignalConnect(x.GoPointer(), "cursor-changed", cbRefPtr)
2169+ glib.SaveHandlerMapping(handlerID, cbPtr)
2170+ return handlerID
2163 }2171 }
2164 2172
2165-func (x *TreeView) ConnectExpandCollapseCursorRow(cb *func(TreeView, bool, bool, bool) bool) uint32 {2173+func (x *TreeView) ConnectExpandCollapseCursorRow(cb *func(TreeView, bool, bool, bool) bool) uint {
2166 cbPtr := uintptr(unsafe.Pointer(cb))2174 cbPtr := uintptr(unsafe.Pointer(cb))
2167 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2175 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2168- return gobject.SignalConnect(x.GoPointer(), "expand-collapse-cursor-row", cbRefPtr)2176+ handlerID := gobject.SignalConnect(x.GoPointer(), "expand-collapse-cursor-row", cbRefPtr)
2177+ glib.SaveHandlerMapping(handlerID, cbPtr)
2178+ return handlerID
2169 }2179 }
2170 2180
2171 fcb := func(clsPtr uintptr, ObjectVarp bool, P0Varp bool, P1Varp bool) bool {2181 fcb := func(clsPtr uintptr, ObjectVarp bool, P0Varp bool, P1Varp bool) bool {
@@ -2178,7 +2188,9 @@ func (x *TreeView) ConnectExpandCollapseCursorRow(cb *func(TreeView, bool, bool,
2178 }2188 }
2179 cbRefPtr := purego.NewCallback(fcb)2189 cbRefPtr := purego.NewCallback(fcb)
2180 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2190 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2181- return gobject.SignalConnect(x.GoPointer(), "expand-collapse-cursor-row", cbRefPtr)2191+ handlerID := gobject.SignalConnect(x.GoPointer(), "expand-collapse-cursor-row", cbRefPtr)
2192+ glib.SaveHandlerMapping(handlerID, cbPtr)
2193+ return handlerID
2182 }2194 }
2183 2195
2184 // The `GtkTreeView`::move-cursor signal is a [keybinding2196 // The `GtkTreeView`::move-cursor signal is a [keybinding
@@ -2190,10 +2202,12 @@ func (x *TreeView) ConnectExpandCollapseCursorRow(cb *func(TreeView, bool, bool,
2190 // programmatically. In contrast to gtk_tree_view_set_cursor() and2202 // programmatically. In contrast to gtk_tree_view_set_cursor() and
2191 // gtk_tree_view_set_cursor_on_cell() when moving horizontally2203 // gtk_tree_view_set_cursor_on_cell() when moving horizontally
2192 // `GtkTreeView`::move-cursor does not reset the current selection.2204 // `GtkTreeView`::move-cursor does not reset the current selection.
2193-func (x *TreeView) ConnectMoveCursor(cb *func(TreeView, MovementStep, int, bool, bool) bool) uint32 {2205+func (x *TreeView) ConnectMoveCursor(cb *func(TreeView, MovementStep, int, bool, bool) bool) uint {
2194 cbPtr := uintptr(unsafe.Pointer(cb))2206 cbPtr := uintptr(unsafe.Pointer(cb))
2195 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2207 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2196- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)2208+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
2209+ glib.SaveHandlerMapping(handlerID, cbPtr)
2210+ return handlerID
2197 }2211 }
2198 2212
2199 fcb := func(clsPtr uintptr, StepVarp MovementStep, DirectionVarp int, ExtendVarp bool, ModifyVarp bool) bool {2213 fcb := func(clsPtr uintptr, StepVarp MovementStep, DirectionVarp int, ExtendVarp bool, ModifyVarp bool) bool {
@@ -2206,7 +2220,9 @@ func (x *TreeView) ConnectMoveCursor(cb *func(TreeView, MovementStep, int, bool,
2206 }2220 }
2207 cbRefPtr := purego.NewCallback(fcb)2221 cbRefPtr := purego.NewCallback(fcb)
2208 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2222 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2209- return gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)2223+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-cursor", cbRefPtr)
2224+ glib.SaveHandlerMapping(handlerID, cbPtr)
2225+ return handlerID
2210 }2226 }
2211 2227
2212 // The "row-activated" signal is emitted when the method2228 // The "row-activated" signal is emitted when the method
@@ -2223,10 +2239,12 @@ func (x *TreeView) ConnectMoveCursor(cb *func(TreeView, MovementStep, int, bool,
2223 // For selection handling refer to the2239 // For selection handling refer to the
2224 // [tree widget conceptual overview](section-tree-widget.html)2240 // [tree widget conceptual overview](section-tree-widget.html)
2225 // as well as `GtkTreeSelection`.2241 // as well as `GtkTreeSelection`.
2226-func (x *TreeView) ConnectRowActivated(cb *func(TreeView, uintptr, uintptr)) uint32 {2242+func (x *TreeView) ConnectRowActivated(cb *func(TreeView, uintptr, uintptr)) uint {
2227 cbPtr := uintptr(unsafe.Pointer(cb))2243 cbPtr := uintptr(unsafe.Pointer(cb))
2228 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2244 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2229- return gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)2245+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)
2246+ glib.SaveHandlerMapping(handlerID, cbPtr)
2247+ return handlerID
2230 }2248 }
2231 2249
2232 fcb := func(clsPtr uintptr, PathVarp uintptr, ColumnVarp uintptr) {2250 fcb := func(clsPtr uintptr, PathVarp uintptr, ColumnVarp uintptr) {
@@ -2239,14 +2257,18 @@ func (x *TreeView) ConnectRowActivated(cb *func(TreeView, uintptr, uintptr)) uin
2239 }2257 }
2240 cbRefPtr := purego.NewCallback(fcb)2258 cbRefPtr := purego.NewCallback(fcb)
2241 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2259 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2242- return gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)2260+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-activated", cbRefPtr)
2261+ glib.SaveHandlerMapping(handlerID, cbPtr)
2262+ return handlerID
2243 }2263 }
2244 2264
2245 // The given row has been collapsed (child nodes are hidden).2265 // The given row has been collapsed (child nodes are hidden).
2246-func (x *TreeView) ConnectRowCollapsed(cb *func(TreeView, uintptr, uintptr)) uint32 {2266+func (x *TreeView) ConnectRowCollapsed(cb *func(TreeView, uintptr, uintptr)) uint {
2247 cbPtr := uintptr(unsafe.Pointer(cb))2267 cbPtr := uintptr(unsafe.Pointer(cb))
2248 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2268 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2249- return gobject.SignalConnect(x.GoPointer(), "row-collapsed", cbRefPtr)2269+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-collapsed", cbRefPtr)
2270+ glib.SaveHandlerMapping(handlerID, cbPtr)
2271+ return handlerID
2250 }2272 }
2251 2273
2252 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) {2274 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) {
@@ -2259,14 +2281,18 @@ func (x *TreeView) ConnectRowCollapsed(cb *func(TreeView, uintptr, uintptr)) uin
2259 }2281 }
2260 cbRefPtr := purego.NewCallback(fcb)2282 cbRefPtr := purego.NewCallback(fcb)
2261 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2283 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2262- return gobject.SignalConnect(x.GoPointer(), "row-collapsed", cbRefPtr)2284+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-collapsed", cbRefPtr)
2285+ glib.SaveHandlerMapping(handlerID, cbPtr)
2286+ return handlerID
2263 }2287 }
2264 2288
2265 // The given row has been expanded (child nodes are shown).2289 // The given row has been expanded (child nodes are shown).
2266-func (x *TreeView) ConnectRowExpanded(cb *func(TreeView, uintptr, uintptr)) uint32 {2290+func (x *TreeView) ConnectRowExpanded(cb *func(TreeView, uintptr, uintptr)) uint {
2267 cbPtr := uintptr(unsafe.Pointer(cb))2291 cbPtr := uintptr(unsafe.Pointer(cb))
2268 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2292 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2269- return gobject.SignalConnect(x.GoPointer(), "row-expanded", cbRefPtr)2293+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-expanded", cbRefPtr)
2294+ glib.SaveHandlerMapping(handlerID, cbPtr)
2295+ return handlerID
2270 }2296 }
2271 2297
2272 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) {2298 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) {
@@ -2279,13 +2305,17 @@ func (x *TreeView) ConnectRowExpanded(cb *func(TreeView, uintptr, uintptr)) uint
2279 }2305 }
2280 cbRefPtr := purego.NewCallback(fcb)2306 cbRefPtr := purego.NewCallback(fcb)
2281 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2307 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2282- return gobject.SignalConnect(x.GoPointer(), "row-expanded", cbRefPtr)2308+ handlerID := gobject.SignalConnect(x.GoPointer(), "row-expanded", cbRefPtr)
2309+ glib.SaveHandlerMapping(handlerID, cbPtr)
2310+ return handlerID
2283 }2311 }
2284 2312
2285-func (x *TreeView) ConnectSelectAll(cb *func(TreeView) bool) uint32 {2313+func (x *TreeView) ConnectSelectAll(cb *func(TreeView) bool) uint {
2286 cbPtr := uintptr(unsafe.Pointer(cb))2314 cbPtr := uintptr(unsafe.Pointer(cb))
2287 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2315 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2288- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)2316+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
2317+ glib.SaveHandlerMapping(handlerID, cbPtr)
2318+ return handlerID
2289 }2319 }
2290 2320
2291 fcb := func(clsPtr uintptr) bool {2321 fcb := func(clsPtr uintptr) bool {
@@ -2298,13 +2328,17 @@ func (x *TreeView) ConnectSelectAll(cb *func(TreeView) bool) uint32 {
2298 }2328 }
2299 cbRefPtr := purego.NewCallback(fcb)2329 cbRefPtr := purego.NewCallback(fcb)
2300 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2330 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2301- return gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)2331+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-all", cbRefPtr)
2332+ glib.SaveHandlerMapping(handlerID, cbPtr)
2333+ return handlerID
2302 }2334 }
2303 2335
2304-func (x *TreeView) ConnectSelectCursorParent(cb *func(TreeView) bool) uint32 {2336+func (x *TreeView) ConnectSelectCursorParent(cb *func(TreeView) bool) uint {
2305 cbPtr := uintptr(unsafe.Pointer(cb))2337 cbPtr := uintptr(unsafe.Pointer(cb))
2306 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2338 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2307- return gobject.SignalConnect(x.GoPointer(), "select-cursor-parent", cbRefPtr)2339+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-cursor-parent", cbRefPtr)
2340+ glib.SaveHandlerMapping(handlerID, cbPtr)
2341+ return handlerID
2308 }2342 }
2309 2343
2310 fcb := func(clsPtr uintptr) bool {2344 fcb := func(clsPtr uintptr) bool {
@@ -2317,13 +2351,17 @@ func (x *TreeView) ConnectSelectCursorParent(cb *func(TreeView) bool) uint32 {
2317 }2351 }
2318 cbRefPtr := purego.NewCallback(fcb)2352 cbRefPtr := purego.NewCallback(fcb)
2319 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2353 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2320- return gobject.SignalConnect(x.GoPointer(), "select-cursor-parent", cbRefPtr)2354+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-cursor-parent", cbRefPtr)
2355+ glib.SaveHandlerMapping(handlerID, cbPtr)
2356+ return handlerID
2321 }2357 }
2322 2358
2323-func (x *TreeView) ConnectSelectCursorRow(cb *func(TreeView, bool) bool) uint32 {2359+func (x *TreeView) ConnectSelectCursorRow(cb *func(TreeView, bool) bool) uint {
2324 cbPtr := uintptr(unsafe.Pointer(cb))2360 cbPtr := uintptr(unsafe.Pointer(cb))
2325 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2361 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2326- return gobject.SignalConnect(x.GoPointer(), "select-cursor-row", cbRefPtr)2362+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-cursor-row", cbRefPtr)
2363+ glib.SaveHandlerMapping(handlerID, cbPtr)
2364+ return handlerID
2327 }2365 }
2328 2366
2329 fcb := func(clsPtr uintptr, ObjectVarp bool) bool {2367 fcb := func(clsPtr uintptr, ObjectVarp bool) bool {
@@ -2336,13 +2374,17 @@ func (x *TreeView) ConnectSelectCursorRow(cb *func(TreeView, bool) bool) uint32
2336 }2374 }
2337 cbRefPtr := purego.NewCallback(fcb)2375 cbRefPtr := purego.NewCallback(fcb)
2338 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2376 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2339- return gobject.SignalConnect(x.GoPointer(), "select-cursor-row", cbRefPtr)2377+ handlerID := gobject.SignalConnect(x.GoPointer(), "select-cursor-row", cbRefPtr)
2378+ glib.SaveHandlerMapping(handlerID, cbPtr)
2379+ return handlerID
2340 }2380 }
2341 2381
2342-func (x *TreeView) ConnectStartInteractiveSearch(cb *func(TreeView) bool) uint32 {2382+func (x *TreeView) ConnectStartInteractiveSearch(cb *func(TreeView) bool) uint {
2343 cbPtr := uintptr(unsafe.Pointer(cb))2383 cbPtr := uintptr(unsafe.Pointer(cb))
2344 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2384 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2345- return gobject.SignalConnect(x.GoPointer(), "start-interactive-search", cbRefPtr)2385+ handlerID := gobject.SignalConnect(x.GoPointer(), "start-interactive-search", cbRefPtr)
2386+ glib.SaveHandlerMapping(handlerID, cbPtr)
2387+ return handlerID
2346 }2388 }
2347 2389
2348 fcb := func(clsPtr uintptr) bool {2390 fcb := func(clsPtr uintptr) bool {
@@ -2355,15 +2397,19 @@ func (x *TreeView) ConnectStartInteractiveSearch(cb *func(TreeView) bool) uint32
2355 }2397 }
2356 cbRefPtr := purego.NewCallback(fcb)2398 cbRefPtr := purego.NewCallback(fcb)
2357 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2399 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2358- return gobject.SignalConnect(x.GoPointer(), "start-interactive-search", cbRefPtr)2400+ handlerID := gobject.SignalConnect(x.GoPointer(), "start-interactive-search", cbRefPtr)
2401+ glib.SaveHandlerMapping(handlerID, cbPtr)
2402+ return handlerID
2359 }2403 }
2360 2404
2361 // The given row is about to be collapsed (hide its children nodes). Use this2405 // The given row is about to be collapsed (hide its children nodes). Use this
2362 // signal if you need to control the collapsibility of individual rows.2406 // signal if you need to control the collapsibility of individual rows.
2363-func (x *TreeView) ConnectTestCollapseRow(cb *func(TreeView, uintptr, uintptr) bool) uint32 {2407+func (x *TreeView) ConnectTestCollapseRow(cb *func(TreeView, uintptr, uintptr) bool) uint {
2364 cbPtr := uintptr(unsafe.Pointer(cb))2408 cbPtr := uintptr(unsafe.Pointer(cb))
2365 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2409 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2366- return gobject.SignalConnect(x.GoPointer(), "test-collapse-row", cbRefPtr)2410+ handlerID := gobject.SignalConnect(x.GoPointer(), "test-collapse-row", cbRefPtr)
2411+ glib.SaveHandlerMapping(handlerID, cbPtr)
2412+ return handlerID
2367 }2413 }
2368 2414
2369 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) bool {2415 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) bool {
@@ -2376,15 +2422,19 @@ func (x *TreeView) ConnectTestCollapseRow(cb *func(TreeView, uintptr, uintptr) b
2376 }2422 }
2377 cbRefPtr := purego.NewCallback(fcb)2423 cbRefPtr := purego.NewCallback(fcb)
2378 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2424 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2379- return gobject.SignalConnect(x.GoPointer(), "test-collapse-row", cbRefPtr)2425+ handlerID := gobject.SignalConnect(x.GoPointer(), "test-collapse-row", cbRefPtr)
2426+ glib.SaveHandlerMapping(handlerID, cbPtr)
2427+ return handlerID
2380 }2428 }
2381 2429
2382 // The given row is about to be expanded (show its children nodes). Use this2430 // The given row is about to be expanded (show its children nodes). Use this
2383 // signal if you need to control the expandability of individual rows.2431 // signal if you need to control the expandability of individual rows.
2384-func (x *TreeView) ConnectTestExpandRow(cb *func(TreeView, uintptr, uintptr) bool) uint32 {2432+func (x *TreeView) ConnectTestExpandRow(cb *func(TreeView, uintptr, uintptr) bool) uint {
2385 cbPtr := uintptr(unsafe.Pointer(cb))2433 cbPtr := uintptr(unsafe.Pointer(cb))
2386 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2434 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2387- return gobject.SignalConnect(x.GoPointer(), "test-expand-row", cbRefPtr)2435+ handlerID := gobject.SignalConnect(x.GoPointer(), "test-expand-row", cbRefPtr)
2436+ glib.SaveHandlerMapping(handlerID, cbPtr)
2437+ return handlerID
2388 }2438 }
2389 2439
2390 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) bool {2440 fcb := func(clsPtr uintptr, IterVarp uintptr, PathVarp uintptr) bool {
@@ -2397,13 +2447,17 @@ func (x *TreeView) ConnectTestExpandRow(cb *func(TreeView, uintptr, uintptr) boo
2397 }2447 }
2398 cbRefPtr := purego.NewCallback(fcb)2448 cbRefPtr := purego.NewCallback(fcb)
2399 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2449 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2400- return gobject.SignalConnect(x.GoPointer(), "test-expand-row", cbRefPtr)2450+ handlerID := gobject.SignalConnect(x.GoPointer(), "test-expand-row", cbRefPtr)
2451+ glib.SaveHandlerMapping(handlerID, cbPtr)
2452+ return handlerID
2401 }2453 }
2402 2454
2403-func (x *TreeView) ConnectToggleCursorRow(cb *func(TreeView) bool) uint32 {2455+func (x *TreeView) ConnectToggleCursorRow(cb *func(TreeView) bool) uint {
2404 cbPtr := uintptr(unsafe.Pointer(cb))2456 cbPtr := uintptr(unsafe.Pointer(cb))
2405 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2457 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2406- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)2458+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)
2459+ glib.SaveHandlerMapping(handlerID, cbPtr)
2460+ return handlerID
2407 }2461 }
2408 2462
2409 fcb := func(clsPtr uintptr) bool {2463 fcb := func(clsPtr uintptr) bool {
@@ -2416,13 +2470,17 @@ func (x *TreeView) ConnectToggleCursorRow(cb *func(TreeView) bool) uint32 {
2416 }2470 }
2417 cbRefPtr := purego.NewCallback(fcb)2471 cbRefPtr := purego.NewCallback(fcb)
2418 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2472 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2419- return gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)2473+ handlerID := gobject.SignalConnect(x.GoPointer(), "toggle-cursor-row", cbRefPtr)
2474+ glib.SaveHandlerMapping(handlerID, cbPtr)
2475+ return handlerID
2420 }2476 }
2421 2477
2422-func (x *TreeView) ConnectUnselectAll(cb *func(TreeView) bool) uint32 {2478+func (x *TreeView) ConnectUnselectAll(cb *func(TreeView) bool) uint {
2423 cbPtr := uintptr(unsafe.Pointer(cb))2479 cbPtr := uintptr(unsafe.Pointer(cb))
2424 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {2480 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
2425- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)2481+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
2482+ glib.SaveHandlerMapping(handlerID, cbPtr)
2483+ return handlerID
2426 }2484 }
2427 2485
2428 fcb := func(clsPtr uintptr) bool {2486 fcb := func(clsPtr uintptr) bool {
@@ -2435,7 +2493,9 @@ func (x *TreeView) ConnectUnselectAll(cb *func(TreeView) bool) uint32 {
2435 }2493 }
2436 cbRefPtr := purego.NewCallback(fcb)2494 cbRefPtr := purego.NewCallback(fcb)
2437 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)2495 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
2438- return gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)2496+ handlerID := gobject.SignalConnect(x.GoPointer(), "unselect-all", cbRefPtr)
2497+ glib.SaveHandlerMapping(handlerID, cbPtr)
2498+ return handlerID
2439 }2499 }
2440 2500
2441 // Requests the user's screen reader to announce the given message.2501 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtktreeviewcolumn.go +7 -3
@@ -980,10 +980,12 @@ func (x *TreeViewColumn) GetPropertyXOffset() int {
980 }980 }
981 981
982 // Emitted when the column's header has been clicked.982 // Emitted when the column's header has been clicked.
983-func (x *TreeViewColumn) ConnectClicked(cb *func(TreeViewColumn)) uint32 {983+func (x *TreeViewColumn) ConnectClicked(cb *func(TreeViewColumn)) uint {
984 cbPtr := uintptr(unsafe.Pointer(cb))984 cbPtr := uintptr(unsafe.Pointer(cb))
985 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {985 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
986- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)986+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
987+ glib.SaveHandlerMapping(handlerID, cbPtr)
988+ return handlerID
987 }989 }
988 990
989 fcb := func(clsPtr uintptr) {991 fcb := func(clsPtr uintptr) {
@@ -996,7 +998,9 @@ func (x *TreeViewColumn) ConnectClicked(cb *func(TreeViewColumn)) uint32 {
996 }998 }
997 cbRefPtr := purego.NewCallback(fcb)999 cbRefPtr := purego.NewCallback(fcb)
998 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1000 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
999- return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)1001+ handlerID := gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr)
1002+ glib.SaveHandlerMapping(handlerID, cbPtr)
1003+ return handlerID
1000 }1004 }
1001 1005
1002 // Gets the ID of the @buildable object.1006 // Gets the ID of the @buildable object.
M v4/gtk/gtkwidget.go +91 -39
@@ -5154,10 +5154,12 @@ func (x *Widget) GetPropertyWidthRequest() int {
5154 // May result in finalization of the widget if all references are released.5154 // May result in finalization of the widget if all references are released.
5155 //5155 //
5156 // This signal is not suitable for saving widget state.5156 // This signal is not suitable for saving widget state.
5157-func (x *Widget) ConnectDestroy(cb *func(Widget)) uint32 {5157+func (x *Widget) ConnectDestroy(cb *func(Widget)) uint {
5158 cbPtr := uintptr(unsafe.Pointer(cb))5158 cbPtr := uintptr(unsafe.Pointer(cb))
5159 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5159 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5160- return gobject.SignalConnect(x.GoPointer(), "destroy", cbRefPtr)5160+ handlerID := gobject.SignalConnect(x.GoPointer(), "destroy", cbRefPtr)
5161+ glib.SaveHandlerMapping(handlerID, cbPtr)
5162+ return handlerID
5161 }5163 }
5162 5164
5163 fcb := func(clsPtr uintptr) {5165 fcb := func(clsPtr uintptr) {
@@ -5170,14 +5172,18 @@ func (x *Widget) ConnectDestroy(cb *func(Widget)) uint32 {
5170 }5172 }
5171 cbRefPtr := purego.NewCallback(fcb)5173 cbRefPtr := purego.NewCallback(fcb)
5172 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5174 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5173- return gobject.SignalConnect(x.GoPointer(), "destroy", cbRefPtr)5175+ handlerID := gobject.SignalConnect(x.GoPointer(), "destroy", cbRefPtr)
5176+ glib.SaveHandlerMapping(handlerID, cbPtr)
5177+ return handlerID
5174 }5178 }
5175 5179
5176 // Emitted when the text direction of a widget changes.5180 // Emitted when the text direction of a widget changes.
5177-func (x *Widget) ConnectDirectionChanged(cb *func(Widget, TextDirection)) uint32 {5181+func (x *Widget) ConnectDirectionChanged(cb *func(Widget, TextDirection)) uint {
5178 cbPtr := uintptr(unsafe.Pointer(cb))5182 cbPtr := uintptr(unsafe.Pointer(cb))
5179 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5183 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5180- return gobject.SignalConnect(x.GoPointer(), "direction-changed", cbRefPtr)5184+ handlerID := gobject.SignalConnect(x.GoPointer(), "direction-changed", cbRefPtr)
5185+ glib.SaveHandlerMapping(handlerID, cbPtr)
5186+ return handlerID
5181 }5187 }
5182 5188
5183 fcb := func(clsPtr uintptr, PreviousDirectionVarp TextDirection) {5189 fcb := func(clsPtr uintptr, PreviousDirectionVarp TextDirection) {
@@ -5190,14 +5196,18 @@ func (x *Widget) ConnectDirectionChanged(cb *func(Widget, TextDirection)) uint32
5190 }5196 }
5191 cbRefPtr := purego.NewCallback(fcb)5197 cbRefPtr := purego.NewCallback(fcb)
5192 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5198 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5193- return gobject.SignalConnect(x.GoPointer(), "direction-changed", cbRefPtr)5199+ handlerID := gobject.SignalConnect(x.GoPointer(), "direction-changed", cbRefPtr)
5200+ glib.SaveHandlerMapping(handlerID, cbPtr)
5201+ return handlerID
5194 }5202 }
5195 5203
5196 // Emitted when @widget is hidden.5204 // Emitted when @widget is hidden.
5197-func (x *Widget) ConnectHide(cb *func(Widget)) uint32 {5205+func (x *Widget) ConnectHide(cb *func(Widget)) uint {
5198 cbPtr := uintptr(unsafe.Pointer(cb))5206 cbPtr := uintptr(unsafe.Pointer(cb))
5199 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5207 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5200- return gobject.SignalConnect(x.GoPointer(), "hide", cbRefPtr)5208+ handlerID := gobject.SignalConnect(x.GoPointer(), "hide", cbRefPtr)
5209+ glib.SaveHandlerMapping(handlerID, cbPtr)
5210+ return handlerID
5201 }5211 }
5202 5212
5203 fcb := func(clsPtr uintptr) {5213 fcb := func(clsPtr uintptr) {
@@ -5210,16 +5220,20 @@ func (x *Widget) ConnectHide(cb *func(Widget)) uint32 {
5210 }5220 }
5211 cbRefPtr := purego.NewCallback(fcb)5221 cbRefPtr := purego.NewCallback(fcb)
5212 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5222 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5213- return gobject.SignalConnect(x.GoPointer(), "hide", cbRefPtr)5223+ handlerID := gobject.SignalConnect(x.GoPointer(), "hide", cbRefPtr)
5224+ glib.SaveHandlerMapping(handlerID, cbPtr)
5225+ return handlerID
5214 }5226 }
5215 5227
5216 // Emitted if keyboard navigation fails.5228 // Emitted if keyboard navigation fails.
5217 //5229 //
5218 // See [method@Gtk.Widget.keynav_failed] for details.5230 // See [method@Gtk.Widget.keynav_failed] for details.
5219-func (x *Widget) ConnectKeynavFailed(cb *func(Widget, DirectionType) bool) uint32 {5231+func (x *Widget) ConnectKeynavFailed(cb *func(Widget, DirectionType) bool) uint {
5220 cbPtr := uintptr(unsafe.Pointer(cb))5232 cbPtr := uintptr(unsafe.Pointer(cb))
5221 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5233 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5222- return gobject.SignalConnect(x.GoPointer(), "keynav-failed", cbRefPtr)5234+ handlerID := gobject.SignalConnect(x.GoPointer(), "keynav-failed", cbRefPtr)
5235+ glib.SaveHandlerMapping(handlerID, cbPtr)
5236+ return handlerID
5223 }5237 }
5224 5238
5225 fcb := func(clsPtr uintptr, DirectionVarp DirectionType) bool {5239 fcb := func(clsPtr uintptr, DirectionVarp DirectionType) bool {
@@ -5232,7 +5246,9 @@ func (x *Widget) ConnectKeynavFailed(cb *func(Widget, DirectionType) bool) uint3
5232 }5246 }
5233 cbRefPtr := purego.NewCallback(fcb)5247 cbRefPtr := purego.NewCallback(fcb)
5234 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5248 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5235- return gobject.SignalConnect(x.GoPointer(), "keynav-failed", cbRefPtr)5249+ handlerID := gobject.SignalConnect(x.GoPointer(), "keynav-failed", cbRefPtr)
5250+ glib.SaveHandlerMapping(handlerID, cbPtr)
5251+ return handlerID
5236 }5252 }
5237 5253
5238 // Emitted when @widget is going to be mapped.5254 // Emitted when @widget is going to be mapped.
@@ -5244,10 +5260,12 @@ func (x *Widget) ConnectKeynavFailed(cb *func(Widget, DirectionType) bool) uint3
5244 // The `::map` signal can be used to determine whether a widget will be drawn,5260 // The `::map` signal can be used to determine whether a widget will be drawn,
5245 // for instance it can resume an animation that was stopped during the5261 // for instance it can resume an animation that was stopped during the
5246 // emission of [signal@Gtk.Widget::unmap].5262 // emission of [signal@Gtk.Widget::unmap].
5247-func (x *Widget) ConnectMap(cb *func(Widget)) uint32 {5263+func (x *Widget) ConnectMap(cb *func(Widget)) uint {
5248 cbPtr := uintptr(unsafe.Pointer(cb))5264 cbPtr := uintptr(unsafe.Pointer(cb))
5249 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5265 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5250- return gobject.SignalConnect(x.GoPointer(), "map", cbRefPtr)5266+ handlerID := gobject.SignalConnect(x.GoPointer(), "map", cbRefPtr)
5267+ glib.SaveHandlerMapping(handlerID, cbPtr)
5268+ return handlerID
5251 }5269 }
5252 5270
5253 fcb := func(clsPtr uintptr) {5271 fcb := func(clsPtr uintptr) {
@@ -5260,17 +5278,21 @@ func (x *Widget) ConnectMap(cb *func(Widget)) uint32 {
5260 }5278 }
5261 cbRefPtr := purego.NewCallback(fcb)5279 cbRefPtr := purego.NewCallback(fcb)
5262 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5280 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5263- return gobject.SignalConnect(x.GoPointer(), "map", cbRefPtr)5281+ handlerID := gobject.SignalConnect(x.GoPointer(), "map", cbRefPtr)
5282+ glib.SaveHandlerMapping(handlerID, cbPtr)
5283+ return handlerID
5264 }5284 }
5265 5285
5266 // Emitted when a widget is activated via a mnemonic.5286 // Emitted when a widget is activated via a mnemonic.
5267 //5287 //
5268 // The default handler for this signal activates @widget if @group_cycling5288 // The default handler for this signal activates @widget if @group_cycling
5269 // is false, or just makes @widget grab focus if @group_cycling is true.5289 // is false, or just makes @widget grab focus if @group_cycling is true.
5270-func (x *Widget) ConnectMnemonicActivate(cb *func(Widget, bool) bool) uint32 {5290+func (x *Widget) ConnectMnemonicActivate(cb *func(Widget, bool) bool) uint {
5271 cbPtr := uintptr(unsafe.Pointer(cb))5291 cbPtr := uintptr(unsafe.Pointer(cb))
5272 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5292 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5273- return gobject.SignalConnect(x.GoPointer(), "mnemonic-activate", cbRefPtr)5293+ handlerID := gobject.SignalConnect(x.GoPointer(), "mnemonic-activate", cbRefPtr)
5294+ glib.SaveHandlerMapping(handlerID, cbPtr)
5295+ return handlerID
5274 }5296 }
5275 5297
5276 fcb := func(clsPtr uintptr, GroupCyclingVarp bool) bool {5298 fcb := func(clsPtr uintptr, GroupCyclingVarp bool) bool {
@@ -5283,7 +5305,9 @@ func (x *Widget) ConnectMnemonicActivate(cb *func(Widget, bool) bool) uint32 {
5283 }5305 }
5284 cbRefPtr := purego.NewCallback(fcb)5306 cbRefPtr := purego.NewCallback(fcb)
5285 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5307 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5286- return gobject.SignalConnect(x.GoPointer(), "mnemonic-activate", cbRefPtr)5308+ handlerID := gobject.SignalConnect(x.GoPointer(), "mnemonic-activate", cbRefPtr)
5309+ glib.SaveHandlerMapping(handlerID, cbPtr)
5310+ return handlerID
5287 }5311 }
5288 5312
5289 // Emitted when the focus is moved.5313 // Emitted when the focus is moved.
@@ -5292,10 +5316,12 @@ func (x *Widget) ConnectMnemonicActivate(cb *func(Widget, bool) bool) uint32 {
5292 //5316 //
5293 // The default bindings for this signal are &lt;kbd&gt;Tab&lt;/kbd&gt; to move forward,5317 // The default bindings for this signal are &lt;kbd&gt;Tab&lt;/kbd&gt; to move forward,
5294 // and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt; to move backward.5318 // and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Tab&lt;/kbd&gt; to move backward.
5295-func (x *Widget) ConnectMoveFocus(cb *func(Widget, DirectionType)) uint32 {5319+func (x *Widget) ConnectMoveFocus(cb *func(Widget, DirectionType)) uint {
5296 cbPtr := uintptr(unsafe.Pointer(cb))5320 cbPtr := uintptr(unsafe.Pointer(cb))
5297 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5321 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5298- return gobject.SignalConnect(x.GoPointer(), "move-focus", cbRefPtr)5322+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus", cbRefPtr)
5323+ glib.SaveHandlerMapping(handlerID, cbPtr)
5324+ return handlerID
5299 }5325 }
5300 5326
5301 fcb := func(clsPtr uintptr, DirectionVarp DirectionType) {5327 fcb := func(clsPtr uintptr, DirectionVarp DirectionType) {
@@ -5308,7 +5334,9 @@ func (x *Widget) ConnectMoveFocus(cb *func(Widget, DirectionType)) uint32 {
5308 }5334 }
5309 cbRefPtr := purego.NewCallback(fcb)5335 cbRefPtr := purego.NewCallback(fcb)
5310 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5336 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5311- return gobject.SignalConnect(x.GoPointer(), "move-focus", cbRefPtr)5337+ handlerID := gobject.SignalConnect(x.GoPointer(), "move-focus", cbRefPtr)
5338+ glib.SaveHandlerMapping(handlerID, cbPtr)
5339+ return handlerID
5312 }5340 }
5313 5341
5314 // Emitted when the widget’s tooltip is about to be shown.5342 // Emitted when the widget’s tooltip is about to be shown.
@@ -5324,10 +5352,12 @@ func (x *Widget) ConnectMoveFocus(cb *func(Widget, DirectionType)) uint32 {
5324 //5352 //
5325 // The signal handler is free to manipulate @tooltip with the therefore5353 // The signal handler is free to manipulate @tooltip with the therefore
5326 // destined function calls.5354 // destined function calls.
5327-func (x *Widget) ConnectQueryTooltip(cb *func(Widget, int, int, bool, uintptr) bool) uint32 {5355+func (x *Widget) ConnectQueryTooltip(cb *func(Widget, int, int, bool, uintptr) bool) uint {
5328 cbPtr := uintptr(unsafe.Pointer(cb))5356 cbPtr := uintptr(unsafe.Pointer(cb))
5329 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5357 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5330- return gobject.SignalConnect(x.GoPointer(), "query-tooltip", cbRefPtr)5358+ handlerID := gobject.SignalConnect(x.GoPointer(), "query-tooltip", cbRefPtr)
5359+ glib.SaveHandlerMapping(handlerID, cbPtr)
5360+ return handlerID
5331 }5361 }
5332 5362
5333 fcb := func(clsPtr uintptr, XVarp int, YVarp int, KeyboardModeVarp bool, TooltipVarp uintptr) bool {5363 fcb := func(clsPtr uintptr, XVarp int, YVarp int, KeyboardModeVarp bool, TooltipVarp uintptr) bool {
@@ -5340,17 +5370,21 @@ func (x *Widget) ConnectQueryTooltip(cb *func(Widget, int, int, bool, uintptr) b
5340 }5370 }
5341 cbRefPtr := purego.NewCallback(fcb)5371 cbRefPtr := purego.NewCallback(fcb)
5342 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5372 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5343- return gobject.SignalConnect(x.GoPointer(), "query-tooltip", cbRefPtr)5373+ handlerID := gobject.SignalConnect(x.GoPointer(), "query-tooltip", cbRefPtr)
5374+ glib.SaveHandlerMapping(handlerID, cbPtr)
5375+ return handlerID
5344 }5376 }
5345 5377
5346 // Emitted when @widget is associated with a `GdkSurface`.5378 // Emitted when @widget is associated with a `GdkSurface`.
5347 //5379 //
5348 // This means that [method@Gtk.Widget.realize] has been called5380 // This means that [method@Gtk.Widget.realize] has been called
5349 // or the widget has been mapped (that is, it is going to be drawn).5381 // or the widget has been mapped (that is, it is going to be drawn).
5350-func (x *Widget) ConnectRealize(cb *func(Widget)) uint32 {5382+func (x *Widget) ConnectRealize(cb *func(Widget)) uint {
5351 cbPtr := uintptr(unsafe.Pointer(cb))5383 cbPtr := uintptr(unsafe.Pointer(cb))
5352 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5384 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5353- return gobject.SignalConnect(x.GoPointer(), "realize", cbRefPtr)5385+ handlerID := gobject.SignalConnect(x.GoPointer(), "realize", cbRefPtr)
5386+ glib.SaveHandlerMapping(handlerID, cbPtr)
5387+ return handlerID
5354 }5388 }
5355 5389
5356 fcb := func(clsPtr uintptr) {5390 fcb := func(clsPtr uintptr) {
@@ -5363,14 +5397,18 @@ func (x *Widget) ConnectRealize(cb *func(Widget)) uint32 {
5363 }5397 }
5364 cbRefPtr := purego.NewCallback(fcb)5398 cbRefPtr := purego.NewCallback(fcb)
5365 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5399 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5366- return gobject.SignalConnect(x.GoPointer(), "realize", cbRefPtr)5400+ handlerID := gobject.SignalConnect(x.GoPointer(), "realize", cbRefPtr)
5401+ glib.SaveHandlerMapping(handlerID, cbPtr)
5402+ return handlerID
5367 }5403 }
5368 5404
5369 // Emitted when @widget is shown.5405 // Emitted when @widget is shown.
5370-func (x *Widget) ConnectShow(cb *func(Widget)) uint32 {5406+func (x *Widget) ConnectShow(cb *func(Widget)) uint {
5371 cbPtr := uintptr(unsafe.Pointer(cb))5407 cbPtr := uintptr(unsafe.Pointer(cb))
5372 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5408 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5373- return gobject.SignalConnect(x.GoPointer(), "show", cbRefPtr)5409+ handlerID := gobject.SignalConnect(x.GoPointer(), "show", cbRefPtr)
5410+ glib.SaveHandlerMapping(handlerID, cbPtr)
5411+ return handlerID
5374 }5412 }
5375 5413
5376 fcb := func(clsPtr uintptr) {5414 fcb := func(clsPtr uintptr) {
@@ -5383,16 +5421,20 @@ func (x *Widget) ConnectShow(cb *func(Widget)) uint32 {
5383 }5421 }
5384 cbRefPtr := purego.NewCallback(fcb)5422 cbRefPtr := purego.NewCallback(fcb)
5385 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5423 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5386- return gobject.SignalConnect(x.GoPointer(), "show", cbRefPtr)5424+ handlerID := gobject.SignalConnect(x.GoPointer(), "show", cbRefPtr)
5425+ glib.SaveHandlerMapping(handlerID, cbPtr)
5426+ return handlerID
5387 }5427 }
5388 5428
5389 // Emitted when the widget state changes.5429 // Emitted when the widget state changes.
5390 //5430 //
5391 // See [method@Gtk.Widget.get_state_flags].5431 // See [method@Gtk.Widget.get_state_flags].
5392-func (x *Widget) ConnectStateFlagsChanged(cb *func(Widget, StateFlags)) uint32 {5432+func (x *Widget) ConnectStateFlagsChanged(cb *func(Widget, StateFlags)) uint {
5393 cbPtr := uintptr(unsafe.Pointer(cb))5433 cbPtr := uintptr(unsafe.Pointer(cb))
5394 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5434 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5395- return gobject.SignalConnect(x.GoPointer(), "state-flags-changed", cbRefPtr)5435+ handlerID := gobject.SignalConnect(x.GoPointer(), "state-flags-changed", cbRefPtr)
5436+ glib.SaveHandlerMapping(handlerID, cbPtr)
5437+ return handlerID
5396 }5438 }
5397 5439
5398 fcb := func(clsPtr uintptr, FlagsVarp StateFlags) {5440 fcb := func(clsPtr uintptr, FlagsVarp StateFlags) {
@@ -5405,7 +5447,9 @@ func (x *Widget) ConnectStateFlagsChanged(cb *func(Widget, StateFlags)) uint32 {
5405 }5447 }
5406 cbRefPtr := purego.NewCallback(fcb)5448 cbRefPtr := purego.NewCallback(fcb)
5407 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5449 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5408- return gobject.SignalConnect(x.GoPointer(), "state-flags-changed", cbRefPtr)5450+ handlerID := gobject.SignalConnect(x.GoPointer(), "state-flags-changed", cbRefPtr)
5451+ glib.SaveHandlerMapping(handlerID, cbPtr)
5452+ return handlerID
5409 }5453 }
5410 5454
5411 // Emitted when @widget is going to be unmapped.5455 // Emitted when @widget is going to be unmapped.
@@ -5415,10 +5459,12 @@ func (x *Widget) ConnectStateFlagsChanged(cb *func(Widget, StateFlags)) uint32 {
5415 //5459 //
5416 // As `::unmap` indicates that a widget will not be shown any longer,5460 // As `::unmap` indicates that a widget will not be shown any longer,
5417 // it can be used to, for example, stop an animation on the widget.5461 // it can be used to, for example, stop an animation on the widget.
5418-func (x *Widget) ConnectUnmap(cb *func(Widget)) uint32 {5462+func (x *Widget) ConnectUnmap(cb *func(Widget)) uint {
5419 cbPtr := uintptr(unsafe.Pointer(cb))5463 cbPtr := uintptr(unsafe.Pointer(cb))
5420 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5464 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5421- return gobject.SignalConnect(x.GoPointer(), "unmap", cbRefPtr)5465+ handlerID := gobject.SignalConnect(x.GoPointer(), "unmap", cbRefPtr)
5466+ glib.SaveHandlerMapping(handlerID, cbPtr)
5467+ return handlerID
5422 }5468 }
5423 5469
5424 fcb := func(clsPtr uintptr) {5470 fcb := func(clsPtr uintptr) {
@@ -5431,17 +5477,21 @@ func (x *Widget) ConnectUnmap(cb *func(Widget)) uint32 {
5431 }5477 }
5432 cbRefPtr := purego.NewCallback(fcb)5478 cbRefPtr := purego.NewCallback(fcb)
5433 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5479 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5434- return gobject.SignalConnect(x.GoPointer(), "unmap", cbRefPtr)5480+ handlerID := gobject.SignalConnect(x.GoPointer(), "unmap", cbRefPtr)
5481+ glib.SaveHandlerMapping(handlerID, cbPtr)
5482+ return handlerID
5435 }5483 }
5436 5484
5437 // Emitted when the `GdkSurface` associated with @widget is destroyed.5485 // Emitted when the `GdkSurface` associated with @widget is destroyed.
5438 //5486 //
5439 // This means that [method@Gtk.Widget.unrealize] has been called5487 // This means that [method@Gtk.Widget.unrealize] has been called
5440 // or the widget has been unmapped (that is, it is going to be hidden).5488 // or the widget has been unmapped (that is, it is going to be hidden).
5441-func (x *Widget) ConnectUnrealize(cb *func(Widget)) uint32 {5489+func (x *Widget) ConnectUnrealize(cb *func(Widget)) uint {
5442 cbPtr := uintptr(unsafe.Pointer(cb))5490 cbPtr := uintptr(unsafe.Pointer(cb))
5443 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {5491 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
5444- return gobject.SignalConnect(x.GoPointer(), "unrealize", cbRefPtr)5492+ handlerID := gobject.SignalConnect(x.GoPointer(), "unrealize", cbRefPtr)
5493+ glib.SaveHandlerMapping(handlerID, cbPtr)
5494+ return handlerID
5445 }5495 }
5446 5496
5447 fcb := func(clsPtr uintptr) {5497 fcb := func(clsPtr uintptr) {
@@ -5454,7 +5504,9 @@ func (x *Widget) ConnectUnrealize(cb *func(Widget)) uint32 {
5454 }5504 }
5455 cbRefPtr := purego.NewCallback(fcb)5505 cbRefPtr := purego.NewCallback(fcb)
5456 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)5506 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
5457- return gobject.SignalConnect(x.GoPointer(), "unrealize", cbRefPtr)5507+ handlerID := gobject.SignalConnect(x.GoPointer(), "unrealize", cbRefPtr)
5508+ glib.SaveHandlerMapping(handlerID, cbPtr)
5509+ return handlerID
5458 }5510 }
5459 5511
5460 // Requests the user's screen reader to announce the given message.5512 // Requests the user's screen reader to announce the given message.
M v4/gtk/gtkwindow.go +35 -15
@@ -1584,10 +1584,12 @@ func (x *Window) GetPropertyTitle() string {
1584 // This is a [keybinding signal](class.SignalAction.html).1584 // This is a [keybinding signal](class.SignalAction.html).
1585 //1585 //
1586 // The keybindings for this signal are all forms of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.1586 // The keybindings for this signal are all forms of the &lt;kbd&gt;Enter&lt;/kbd&gt; key.
1587-func (x *Window) ConnectActivateDefault(cb *func(Window)) uint32 {1587+func (x *Window) ConnectActivateDefault(cb *func(Window)) uint {
1588 cbPtr := uintptr(unsafe.Pointer(cb))1588 cbPtr := uintptr(unsafe.Pointer(cb))
1589 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1589 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1590- return gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)1590+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
1591+ glib.SaveHandlerMapping(handlerID, cbPtr)
1592+ return handlerID
1591 }1593 }
1592 1594
1593 fcb := func(clsPtr uintptr) {1595 fcb := func(clsPtr uintptr) {
@@ -1600,7 +1602,9 @@ func (x *Window) ConnectActivateDefault(cb *func(Window)) uint32 {
1600 }1602 }
1601 cbRefPtr := purego.NewCallback(fcb)1603 cbRefPtr := purego.NewCallback(fcb)
1602 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1604 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1603- return gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)1605+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-default", cbRefPtr)
1606+ glib.SaveHandlerMapping(handlerID, cbPtr)
1607+ return handlerID
1604 }1608 }
1605 1609
1606 // Emitted when the user activates the currently focused1610 // Emitted when the user activates the currently focused
@@ -1609,10 +1613,12 @@ func (x *Window) ConnectActivateDefault(cb *func(Window)) uint32 {
1609 // This is a [keybinding signal](class.SignalAction.html).1613 // This is a [keybinding signal](class.SignalAction.html).
1610 //1614 //
1611 // The default binding for this signal is &lt;kbd&gt;␣&lt;/kbd&gt;.1615 // The default binding for this signal is &lt;kbd&gt;␣&lt;/kbd&gt;.
1612-func (x *Window) ConnectActivateFocus(cb *func(Window)) uint32 {1616+func (x *Window) ConnectActivateFocus(cb *func(Window)) uint {
1613 cbPtr := uintptr(unsafe.Pointer(cb))1617 cbPtr := uintptr(unsafe.Pointer(cb))
1614 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1618 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1615- return gobject.SignalConnect(x.GoPointer(), "activate-focus", cbRefPtr)1619+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-focus", cbRefPtr)
1620+ glib.SaveHandlerMapping(handlerID, cbPtr)
1621+ return handlerID
1616 }1622 }
1617 1623
1618 fcb := func(clsPtr uintptr) {1624 fcb := func(clsPtr uintptr) {
@@ -1625,14 +1631,18 @@ func (x *Window) ConnectActivateFocus(cb *func(Window)) uint32 {
1625 }1631 }
1626 cbRefPtr := purego.NewCallback(fcb)1632 cbRefPtr := purego.NewCallback(fcb)
1627 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1633 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1628- return gobject.SignalConnect(x.GoPointer(), "activate-focus", cbRefPtr)1634+ handlerID := gobject.SignalConnect(x.GoPointer(), "activate-focus", cbRefPtr)
1635+ glib.SaveHandlerMapping(handlerID, cbPtr)
1636+ return handlerID
1629 }1637 }
1630 1638
1631 // Emitted when the user clicks on the close button of the window.1639 // Emitted when the user clicks on the close button of the window.
1632-func (x *Window) ConnectCloseRequest(cb *func(Window) bool) uint32 {1640+func (x *Window) ConnectCloseRequest(cb *func(Window) bool) uint {
1633 cbPtr := uintptr(unsafe.Pointer(cb))1641 cbPtr := uintptr(unsafe.Pointer(cb))
1634 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1642 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1635- return gobject.SignalConnect(x.GoPointer(), "close-request", cbRefPtr)1643+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-request", cbRefPtr)
1644+ glib.SaveHandlerMapping(handlerID, cbPtr)
1645+ return handlerID
1636 }1646 }
1637 1647
1638 fcb := func(clsPtr uintptr) bool {1648 fcb := func(clsPtr uintptr) bool {
@@ -1645,7 +1655,9 @@ func (x *Window) ConnectCloseRequest(cb *func(Window) bool) uint32 {
1645 }1655 }
1646 cbRefPtr := purego.NewCallback(fcb)1656 cbRefPtr := purego.NewCallback(fcb)
1647 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1657 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1648- return gobject.SignalConnect(x.GoPointer(), "close-request", cbRefPtr)1658+ handlerID := gobject.SignalConnect(x.GoPointer(), "close-request", cbRefPtr)
1659+ glib.SaveHandlerMapping(handlerID, cbPtr)
1660+ return handlerID
1649 }1661 }
1650 1662
1651 // Emitted when the user enables or disables interactive debugging.1663 // Emitted when the user enables or disables interactive debugging.
@@ -1659,10 +1671,12 @@ func (x *Window) ConnectCloseRequest(cb *func(Window) bool) uint32 {
1659 // The default bindings for this signal are1671 // The default bindings for this signal are
1660 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt; and1672 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt; and
1661 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;D&lt;/kbd&gt;.1673 // &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;D&lt;/kbd&gt;.
1662-func (x *Window) ConnectEnableDebugging(cb *func(Window, bool) bool) uint32 {1674+func (x *Window) ConnectEnableDebugging(cb *func(Window, bool) bool) uint {
1663 cbPtr := uintptr(unsafe.Pointer(cb))1675 cbPtr := uintptr(unsafe.Pointer(cb))
1664 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1676 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1665- return gobject.SignalConnect(x.GoPointer(), "enable-debugging", cbRefPtr)1677+ handlerID := gobject.SignalConnect(x.GoPointer(), "enable-debugging", cbRefPtr)
1678+ glib.SaveHandlerMapping(handlerID, cbPtr)
1679+ return handlerID
1666 }1680 }
1667 1681
1668 fcb := func(clsPtr uintptr, ToggleVarp bool) bool {1682 fcb := func(clsPtr uintptr, ToggleVarp bool) bool {
@@ -1675,15 +1689,19 @@ func (x *Window) ConnectEnableDebugging(cb *func(Window, bool) bool) uint32 {
1675 }1689 }
1676 cbRefPtr := purego.NewCallback(fcb)1690 cbRefPtr := purego.NewCallback(fcb)
1677 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1691 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1678- return gobject.SignalConnect(x.GoPointer(), "enable-debugging", cbRefPtr)1692+ handlerID := gobject.SignalConnect(x.GoPointer(), "enable-debugging", cbRefPtr)
1693+ glib.SaveHandlerMapping(handlerID, cbPtr)
1694+ return handlerID
1679 }1695 }
1680 1696
1681 // Emitted when the set of accelerators or mnemonics that1697 // Emitted when the set of accelerators or mnemonics that
1682 // are associated with the window changes.1698 // are associated with the window changes.
1683-func (x *Window) ConnectKeysChanged(cb *func(Window)) uint32 {1699+func (x *Window) ConnectKeysChanged(cb *func(Window)) uint {
1684 cbPtr := uintptr(unsafe.Pointer(cb))1700 cbPtr := uintptr(unsafe.Pointer(cb))
1685 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {1701 if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
1686- return gobject.SignalConnect(x.GoPointer(), "keys-changed", cbRefPtr)1702+ handlerID := gobject.SignalConnect(x.GoPointer(), "keys-changed", cbRefPtr)
1703+ glib.SaveHandlerMapping(handlerID, cbPtr)
1704+ return handlerID
1687 }1705 }
1688 1706
1689 fcb := func(clsPtr uintptr) {1707 fcb := func(clsPtr uintptr) {
@@ -1696,7 +1714,9 @@ func (x *Window) ConnectKeysChanged(cb *func(Window)) uint32 {
1696 }1714 }
1697 cbRefPtr := purego.NewCallback(fcb)1715 cbRefPtr := purego.NewCallback(fcb)
1698 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)1716 glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
1699- return gobject.SignalConnect(x.GoPointer(), "keys-changed", cbRefPtr)1717+ handlerID := gobject.SignalConnect(x.GoPointer(), "keys-changed", cbRefPtr)
1718+ glib.SaveHandlerMapping(handlerID, cbPtr)
1719+ return handlerID
1700 }1720 }
1701 1721
1702 // Requests the user's screen reader to announce the given message.1722 // Requests the user's screen reader to announce the given message.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close