mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Masahiro Yamada <masahiroy@kernel.org>, linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/9] kconfig: gconf: use configure-event handler to adjust pane separator
Date: Mon, 30 Jun 2025 16:11:14 -0700	[thread overview]
Message-ID: <eddc5de9-5007-45eb-9d61-668d1225e211@infradead.org> (raw)
In-Reply-To: <20250629184554.407497-3-masahiroy@kernel.org>



On 6/29/25 11:43 AM, Masahiro Yamada wrote:
> The size_request event handler is currently used to adjust the position
> of the horizontal separator in the right pane.
> 
> However, the size_request signal is not available in GTK 3. Use the
> configure-event signal instead.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
> 
> Changes in v2:
>   - Use the "configure-event" instead of "size-allocate" signal.
>     This fixes the problem where we cannot move the horizontal
>     separator in the right pane.
> 
>  scripts/kconfig/gconf.c | 25 +++++++------------------
>  1 file changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 22badd2f710e..8b19298eef61 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -604,23 +604,12 @@ static void on_window1_destroy(GtkObject *object, gpointer user_data)
>  	gtk_main_quit();
>  }
>  
> -static void on_window1_size_request(GtkWidget *widget,
> -				    GtkRequisition *requisition,
> -				    gpointer user_data)
> +static gboolean on_window1_configure(GtkWidget *self,
> +				     GdkEventConfigure *event,
> +				     gpointer user_data)
>  {
> -	static gint old_h;
> -	gint w, h;
> -
> -	if (widget->window == NULL)
> -		gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
> -	else
> -		gdk_window_get_size(widget->window, &w, &h);
> -
> -	if (h == old_h)
> -		return;
> -	old_h = h;
> -
> -	gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
> +	gtk_paned_set_position(GTK_PANED(vpaned), 2 * event->height / 3);
> +	return FALSE;
>  }
>  
>  static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
> @@ -1021,8 +1010,8 @@ static void init_main_window(const gchar *glade_file)
>  	main_wnd = glade_xml_get_widget(xml, "window1");
>  	g_signal_connect(main_wnd, "destroy",
>  			 G_CALLBACK(on_window1_destroy), NULL);
> -	g_signal_connect(main_wnd, "size_request",
> -			 G_CALLBACK(on_window1_size_request), NULL);
> +	g_signal_connect(main_wnd, "configure-event",
> +			 G_CALLBACK(on_window1_configure), NULL);
>  	g_signal_connect(main_wnd, "delete_event",
>  			 G_CALLBACK(on_window1_delete_event), NULL);
>  

-- 
~Randy

  reply	other threads:[~2025-06-30 23:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-29 18:43 [PATCH v2 0/9] kconfig: improve gconfig Masahiro Yamada
2025-06-29 18:43 ` [PATCH v2 1/9] kconfig: gconf: fix behavior of a menu under a symbol in split view Masahiro Yamada
2025-06-29 18:43 ` [PATCH v2 2/9] kconfig: gconf: use configure-event handler to adjust pane separator Masahiro Yamada
2025-06-30 23:11   ` Randy Dunlap [this message]
2025-06-29 18:43 ` [PATCH v2 3/9] kconfig: gconf: rename display_tree_part() Masahiro Yamada
2025-06-29 18:43 ` [PATCH v2 4/9] kconfig: gconf: rename gconf.glade to gconf.ui Masahiro Yamada
2025-06-30 23:12   ` Randy Dunlap
2025-06-29 18:43 ` [PATCH v2 5/9] kconfig: gconf: migrate to GTK 3 Masahiro Yamada
2025-06-30  4:34   ` Masahiro Yamada
2025-06-30 23:14   ` Randy Dunlap
2025-06-29 18:43 ` [PATCH v2 6/9] kconfig: gconf: replace GtkVbox with GtkBox Masahiro Yamada
2025-06-29 18:43 ` [PATCH v2 7/9] kconfig: gconf: replace GdkColor with GdkRGBA Masahiro Yamada
2025-06-30 23:15   ` Randy Dunlap
2025-06-29 18:43 ` [PATCH v2 8/9] kconfig: gconf: replace GtkHPaned and GtkVPaned with GtkPaned Masahiro Yamada
2025-06-29 18:43 ` [PATCH v2 9/9] kconfig: gconf: show GTK version in About dialog Masahiro Yamada
2025-06-30 23:16   ` Randy Dunlap
2025-06-29 19:02 ` [PATCH v2 0/9] kconfig: improve gconfig Randy Dunlap
2025-06-30  4:37   ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eddc5de9-5007-45eb-9d61-668d1225e211@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®