From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: GTK "decorated" and "deletable" properties Date: Fri, 03 Jun 2011 19:39:05 +0200 Message-ID: <4DE91C39.9030705@swipnet.se> References: <87aaebbndz.fsf@lifelogs.com> <4DDDA5A7.6040109@siege-engine.com> <87boyp5vyi.fsf@lifelogs.com> <87mxi8xq6y.fsf@lifelogs.com> <874o4ebtq0.fsf_-_@lifelogs.com> <87vcwpsa6y.fsf@lifelogs.com> <871uzccr2k.fsf@lifelogs.com> <8362oof70y.fsf@gnu.org> <87zkm09iaf.fsf_-_@lifelogs.com> <8339jsez65.fsf@gnu.org> <87oc2g9cg1.fsf@lifelogs.com> <4DE8FBEF.2090900@swipnet.se> <877h92g9pj.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1307122965 13286 80.91.229.12 (3 Jun 2011 17:42:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Jun 2011 17:42:45 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 03 19:42:39 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 1QSYOM-0008I3-On for ged-emacs-devel@m.gmane.org; Fri, 03 Jun 2011 19:42:38 +0200 Original-Received: from localhost ([::1]:47556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSYOL-0001XW-GQ for ged-emacs-devel@m.gmane.org; Fri, 03 Jun 2011 13:42:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSYL2-0000lh-IV for emacs-devel@gnu.org; Fri, 03 Jun 2011 13:39:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSYL0-0005eX-4X for emacs-devel@gnu.org; Fri, 03 Jun 2011 13:39:12 -0400 Original-Received: from smtprelay-b21.telenor.se ([195.54.99.212]:50668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSYKz-0005eR-K6 for emacs-devel@gnu.org; Fri, 03 Jun 2011 13:39:10 -0400 Original-Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-b21.telenor.se (Postfix) with ESMTP id 44F3BEB22A for ; Fri, 3 Jun 2011 19:39:07 +0200 (CEST) X-SENDER-IP: [85.225.45.100] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgxqAHUb6U1V4S1kPGdsb2JhbABTmBuOHgsBAQEBNzKIccEchiEElTyKcw X-IronPort-AV: E=Sophos;i="4.65,315,1304287200"; d="scan'208";a="1736062020" Original-Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb4.telenor.se with ESMTP; 03 Jun 2011 19:39:06 +0200 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 520E47FA05A for ; Fri, 3 Jun 2011 19:39:06 +0200 (CEST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: <877h92g9pj.fsf@lifelogs.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.54.99.212 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:140142 Archived-At: Ted Zlatanov skrev 2011-06-03 18.29: > On Fri, 03 Jun 2011 17:21:19 +0200 Jan Dj=E4rv wro= te: > > > JD> These functions just set the MotifWMHints. So we should make sure= it > JD> works on all X11 ports, not just Gtk+. Also, can these new frame > JD> parameters be generalized into something that makes sense on all p= orts > JD> (W32, Nextstep)? > > GTK on W32 respects the decorated hint and passes it on correctly, > according to the docs. It's not clear from the docs if W32 itself will > display the window without decorations, but it seems so: "On Windows, > this function always works, since there's no window manager policy > involved." > Emacs does not suppoty Gtk+ on anything but X11. > On NextStep / Cocoa, according to > http://www.cocoadev.com/index.pl?BorderlessWindow it's possible but suc= h > a window can't have a toolbar (does it crash or simply ignore the > toolbar? that's not clear). For my purposes that's OK, the pop-up > frames I need won't have toolbars. > > It would be nice if each port offered even more control through native > frame properties, of course, e.g. ns-borderless and gtk-deletable. I > can then set each native property and it has no effect otherwise. But = a > general name convention is useful too. > For X11 you can do it in lisp. Here is a function from an earlier bug re= port=20 about Motif WM Hints (4363). Gtk+ (as far as I know) only manipulates=20 functions and decorations. Motif wm hits is just a property with 5 values. Just use x-change-window-= property. (defun make-special-frame (data) (let ((ff (make-frame '((visibility . nil))))) (progn (x-change-window-property "_MOTIF_WM_HINTS" data ff "_MOTIF_WM_HINTS" 32 t) (make-frame-visible ff)))) To make a frame without decoration (gtk_window_decorated): (make-special-frame '(2 0 0 0 0)) To make a frame without delete (gtk_window_deletable): (make-special-frame '(1 33 0 0 0)) The first value tells what to change (from /usr/include/Xm/MwmUtils.h): #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) The second is the functions: #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) The third is the decorations: #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) Note that most wm:s just check MWM_HINTS when the window is mapped, thats= why=20 the function creates it invisible at first. If a frame is visible, you must (make-frame-invisble),=20 (x-change-window-properties...) (make-frame-visible). Jan D.