Skip to content

Conversation

@akurtakov
Copy link
Member

It shouldn't call GTK 3 function (causes a crash right now) and same approach as cut/copy is used.

@akurtakov akurtakov added the gtk4 GTK4 issues label May 13, 2025
It shouldn't call GTK 3 function (causes a crash right now) and same
approach as cut/copy is used.
@github-actions
Copy link
Contributor

github-actions bot commented May 13, 2025

Test Results

   408 files   -   137     408 suites   - 137   20m 47s ⏱️ - 13m 42s
 4 343 tests  -    37   4 327 ✅  -    35   16 💤  -  2  0 ❌ ±0 
12 542 runs   - 4 108  12 428 ✅  - 4 081  114 💤  - 27  0 ❌ ±0 

Results for commit f09d0ca. ± Comparison against base commit a13a22d.

This pull request removes 37 tests.
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_dollarSign
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_emptyString
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_letterA
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_letters
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16LE_null
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_AsciiLetters
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_Asciiletter
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_LotsOfLetters
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_letter
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_letters
…

♻️ This comment has been updated with latest results.

@akurtakov
Copy link
Member Author

akurtakov commented May 13, 2025

Fixes #1837 linkage error . It doesn't function proper although similar C snippet works just fine:

#include <gtk/gtk.h>

GtkWidget *window;
GtkWidget *combo;
GtkWidget *combo2;
GtkWidget *cut;
GtkWidget *box;

static void
cutpaste (GtkWidget *widget,
             gpointer   data)
{
	GtkWidget *entry;
	GtkWidget *entry2;
	entry = gtk_combo_box_get_child(GTK_COMBO_BOX(combo));
	gtk_widget_activate_action(gtk_widget_get_first_child(GTK_WIDGET(entry)), "clipboard.cut", NULL);
	entry2 = gtk_combo_box_get_child(GTK_COMBO_BOX(combo2));
	gtk_widget_activate_action(gtk_widget_get_first_child(GTK_WIDGET(entry2)), "clipboard.paste", NULL);
}

static void activate(GtkApplication *app, gpointer user_data) {

	window = gtk_application_window_new(app);
	gtk_window_set_title(GTK_WINDOW(window), "Hello");
	gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);

	combo = gtk_combo_box_text_new_with_entry();
	combo2 = gtk_combo_box_text_new_with_entry();
	gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(combo), 0, "test", "proba");
	gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);

//  gtk_widget_activate_action(GTK_WIDGET(button), "clipboard.paste", NULL);
	cut = gtk_button_new_with_label("cut");
	g_signal_connect(cut, "clicked", G_CALLBACK (cutpaste), NULL);
	box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
	gtk_box_append(GTK_BOX(box), combo);
	gtk_box_append(GTK_BOX(box), cut);
	gtk_box_append(GTK_BOX(box), combo2);
	gtk_window_set_child(GTK_WINDOW(window), box);

	gtk_window_present(GTK_WINDOW(window));
}

int main(int argc, char **argv) {
	GtkApplication *app;
	int status;

	app = gtk_application_new("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
	g_signal_connect(app, "activate", G_CALLBACK (activate), NULL);
	status = g_application_run(G_APPLICATION(app), argc, argv);
	g_object_unref(app);

	return status;
}

Merging as non functional paste is still better than hard crash.

@akurtakov akurtakov merged commit 1b7b9bb into eclipse-platform:master May 13, 2025
20 of 22 checks passed
@akurtakov akurtakov self-assigned this May 13, 2025
@akurtakov akurtakov moved this to Done in SWT work May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gtk4 GTK4 issues

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant