From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrey Smirnov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Change the look of dialogs created with `x-popup-dialog' Date: Fri, 16 Dec 2011 09:32:03 -0800 Message-ID: References: <890BD378-D3CE-41CE-AEC0-7CEAA1D8CE05@swipnet.se> <4EEB4AE2.5080909@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1324056739 30801 80.91.229.12 (16 Dec 2011 17:32:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Dec 2011 17:32:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Jan D." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 16 18:32:14 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rbbdk-0003Yf-3V for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2011 18:32:12 +0100 Original-Received: from localhost ([::1]:39201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rbbdj-0002B1-J6 for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2011 12:32:11 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rbbdf-0002AF-9l for emacs-devel@gnu.org; Fri, 16 Dec 2011 12:32:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rbbdd-0003w0-3i for emacs-devel@gnu.org; Fri, 16 Dec 2011 12:32:07 -0500 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:65469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rbbdd-0003vi-00 for emacs-devel@gnu.org; Fri, 16 Dec 2011 12:32:05 -0500 Original-Received: by ghrr18 with SMTP id r18so2629419ghr.0 for ; Fri, 16 Dec 2011 09:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Ncf2Ck7MAS2jNxIaiUIdWO5ttntoxex4wDkRlajVGdU=; b=ULQrEt+Lerc/EHrm4QMb/B7Jrf9XDeZVosgANf5nE691StlE42XsxkwlVJDlq334Gi U0JK9G5/mENKT5mnbnk4xw9+rgcLY6cwRKeJxAy5D+O9MkxkA+h16zeDi2I2VlNZI0K3 Hb/PZkinSdQViojjF0rSUGzVEV6ybbZicqcFI= Original-Received: by 10.50.220.164 with SMTP id px4mr9609648igc.8.1324056723284; Fri, 16 Dec 2011 09:32:03 -0800 (PST) Original-Received: by 10.50.237.74 with HTTP; Fri, 16 Dec 2011 09:32:03 -0800 (PST) In-Reply-To: <4EEB4AE2.5080909@swipnet.se> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146744 Archived-At: On Fri, Dec 16, 2011 at 5:42 AM, Jan D. wrote: > Andrey Smirnov skrev 2011-12-15 05:56: > >> On Wed, Dec 14, 2011 at 12:41 PM, Jan Dj=E4rv =A0wro= te: >>> >>> If you Alt-tab in icewm for example, it shows the titles, see >>> attached picture. >> >> >> Now, I see your point. On the other hand in Unity window title doesn't >> play that important role in window-switching. Can we compromise on >> exposing run-time variable something along the lines of >> `gtk-popup-dialogs-show-titles' and then the appearance could be >> controlled from user's .emacs? >> > > I think we should keep the same title as we had before. =A0Those that nee= d it > really need it, and those that don't won't notice it. Not true, I don't need it but notice how, IMHO, ugly it is. :) But, of course, if you insist, I'll add it. >> All right, in for a penny in for a pound, how about >> `gtk-popup-dialogs-message-format' to control that aspect? > > > I'm not opposed to using larger and bold, but I think we need some sort o= f > poll, or a descision from the maintainers. > > >> >>> >>> Perhaps, but then we maybe should change all ports? >> >> >> Do you mean change how dialogs look in all toolkits? > > > Actually I was just talking about larger and bold here. > Oh, OK, but I'm still looking into other toolkit's code. >> >> It still won't change the fact that original >> `dialog_selection_callback' duplicates the functionality of >> `popup_deactivate_callback'. > > > Yes, but that is something we won't want to change, as some toolkits can'= t > chain callbacks as Gtk+ can. =A0And it forces changes for other toolkits = as > well, for a small gain in clarity. There are two versions of `dialog_selection_callback' already: Gtk-specific and `dialog_selection_callback' for any other toolkit. How do my changes to Gtk-specific version force change on any other toolkits? And in this version of the patch even the chaining isn't needed anymore. >> >> I attached reworked version of the patch, it still lacks comments with >> description for new functions, but I'll add it as soon as the code >> stabilizes. >> > > You are still not resetting popup_activated_flag. I know, see my comment above. > > +struct xg_popup_dialog_callback_data > +{ > + =A0void (*select_cb) (GtkWidget *, gpointer); > + =A0void (*deactivate_cb) (GtkWidget *, gpointer); > + =A0gboolean multichoice_p; > + =A0GSList *radio_buttons; > +}; > + > > You could use GCallback here and cast functions with GCALLBACK(). =A0It i= s > more Gtk-ish. And then I would still, have to cast them to `void (*) (GtkWidget *, gpointer)' in order to actually call them in `popup_dialog_response_cb'. > Otherwise, make a typedef like: > =A0typedef void (*Xg_CBfunction) (GtkWidget *, gpointer); > and use Xg_CBfunction. OK, since I already defined the structure whose definition isn't used more than twice, I think I'll stick with this option. > > + =A0 =A0 =A0struct xg_popup_dialog_callback_data *data =3D g_malloc (siz= eof > (*data)); > > This is never free:d. Am I missing something and the last line in `popup_dialog_response_cb': g_free (user_data); is never reached? Although it was true for a piece of code(case GTK_RESPONSE_DELETE_EVENT) I forgot to correct. Already fixed that. Andrey Smirnov