From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: frame sans decoration Date: Fri, 27 May 2005 04:02:04 +0900 (JST) Message-ID: <20050527.040204.182736682.jet@gyve.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1117135653 20230 80.91.229.2 (26 May 2005 19:27:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 19:27:33 +0000 (UTC) Cc: zappo@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 26 21:27:19 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbNye-00023v-Fh for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 21:25:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbO2m-0004uW-0k for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 15:29:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbNzt-00032J-9S for emacs-devel@gnu.org; Thu, 26 May 2005 15:26:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbNzr-000316-Ae for emacs-devel@gnu.org; Thu, 26 May 2005 15:26:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbNzq-0002iO-5L for emacs-devel@gnu.org; Thu, 26 May 2005 15:26:22 -0400 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbNj7-0007aA-HM; Thu, 26 May 2005 15:09:06 -0400 Original-Received: from localhost (h219-110-076-212.catv01.itscom.jp [219.110.76.212]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id j4QJ8Id00171; Fri, 27 May 2005 04:08:18 +0900 (JST) Original-To: emacs-devel@gnu.org X-Mailer: Mew version 4.2 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37728 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37728 I know well that we are in feature-freeze stage. However, I think the feature provided by following patch is too good to be dropped from the next release. As subject says, you can control(show or hide) window decorations attached to frames by a window manager on X11 window system. (Currently my patch only support emacs built with gtk+.) As you can see, the patch is very short. Actually I have not taken much time for this patch. However, I think the impact of this patch is not small. With this patch, you can use a frame as a tooltip window. Advantages over the conventional tooltip window are: (1) you can handle input to a tooltip window with elisp code, (2) you can use text with faces and pixmap images, and (3) you can contorol the text with faces and pixmap images with elisp code. (4) scrollbar Potential applications are: - This patch may satisfy the request 2 in http://lists.gnu.org/archive/html/emacs-devel/2004-03/msg00035.html - Something like postit like application can be implemented with this patch. - Better Kana->Kanji Conversion window can be implemented with this patch. - Inline eldoc - Inline descripbe-char - you can get one more line for emacs from you display:-P ... People may write interesting elisp applications. To test, apply the patch, then evaluate the following sexp. (progn (setq mode-line-format nil) (make-frame '((minibuffer . nil) (decoration . nil) (background-color . "#ffffBB") (width . 40) (height . 10) (internal-border-width . 10) (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) (unsplittable . t) (has-modeline-p . nil) (left-fringe . 0) (vertical-scroll-bars . nil) (right-fringe . 0)))) If you need screenshots, talk to me. Regards, Masatake YAMATO p.s. I'll write ChangeLog entry if this patch is still acceptable for the release. Index: src/xterm.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/xterm.h,v retrieving revision 1.172 diff -u -r1.172 xterm.h --- src/xterm.h 8 Jan 2005 16:49:14 -0000 1.172 +++ src/xterm.h 26 May 2005 18:35:40 -0000 @@ -988,6 +988,7 @@ extern void x_lower_frame P_ ((struct frame *)); extern void x_make_frame_visible P_ ((struct frame *)); extern void x_make_frame_invisible P_ ((struct frame *)); +extern void x_set_frame_decoration P_ ((struct frame *, int)); extern void x_iconify_frame P_ ((struct frame *)); extern void x_free_frame_resources P_ ((struct frame *)); extern void x_destroy_window P_ ((struct frame *)); Index: src/xterm.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xterm.c,v retrieving revision 1.864 diff -u -r1.864 xterm.c --- src/xterm.c 10 May 2005 09:19:19 -0000 1.864 +++ src/xterm.c 26 May 2005 18:35:42 -0000 @@ -9271,6 +9271,23 @@ XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); } +void +x_set_frame_decoration (f, decoration) + struct frame *f; + int decoration; +{ +#ifdef USE_GTK + if (FRAME_GTK_OUTER_WIDGET (f)) + { + BLOCK_INPUT; + gtk_window_set_decorated(GTK_WINDOW(FRAME_GTK_OUTER_WIDGET (f)), + (gboolean)decoration); + UNBLOCK_INPUT; + } +#endif +} + + /*********************************************************************** Fonts Index: src/xfns.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xfns.c,v retrieving revision 1.639 diff -u -r1.639 xfns.c --- src/xfns.c 10 May 2005 09:17:29 -0000 1.639 +++ src/xfns.c 26 May 2005 18:35:43 -0000 @@ -3269,6 +3269,10 @@ x_window (f); #endif + /* (f)->output_data.x->widget is needed to control the decoration. */ + x_default_parameter (f, parms, Qdecoration, Qt, + "decoration", "Decoration", RES_TYPE_BOOLEAN); + x_icon (f, parms); x_make_gc (f); @@ -5623,6 +5627,7 @@ x_set_fringe_width, x_set_wait_for_wm, x_set_fullscreen, + x_set_decoration, }; void Index: src/frame.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/frame.h,v retrieving revision 1.108 diff -u -r1.108 frame.h --- src/frame.h 30 Dec 2004 12:24:03 -0000 1.108 +++ src/frame.h 26 May 2005 18:35:43 -0000 @@ -319,6 +319,9 @@ /* See FULLSCREEN_ enum below */ int want_fullscreen; + /* Decoration added to a frame by a window manager*/ + int decoration; + /* Number of lines of menu bar. */ int menu_bar_lines; @@ -1003,6 +1006,7 @@ extern Lisp_Object Qline_spacing; extern Lisp_Object Qwait_for_wm; extern Lisp_Object Qfullscreen; +extern Lisp_Object Qdecoration; extern Lisp_Object Qleft_fringe, Qright_fringe; extern Lisp_Object Qheight, Qwidth; @@ -1059,6 +1063,7 @@ extern void x_report_frame_params P_ ((struct frame *, Lisp_Object *)); extern void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object)); +extern void x_set_decoration P_ ((struct frame *, Lisp_Object, Lisp_Object)); extern void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object)); extern void x_set_screen_gamma P_ ((struct frame *, Lisp_Object, Lisp_Object)); extern void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object)); Index: src/frame.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/frame.c,v retrieving revision 1.315 diff -u -r1.315 frame.c --- src/frame.c 24 Apr 2005 06:03:58 -0000 1.315 +++ src/frame.c 26 May 2005 18:35:45 -0000 @@ -108,6 +108,7 @@ Lisp_Object Qtty_color_mode; Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; +Lisp_Object Qdecoration; Lisp_Object Qface_set_after_frame_default; @@ -297,6 +298,8 @@ #ifdef HAVE_WINDOW_SYSTEM f->want_fullscreen = FULLSCREEN_NONE; #endif + f->decoration = 1; + f->size_hint_flags = 0; f->win_gravity = 0; @@ -2575,6 +2578,7 @@ {"right-fringe", &Qright_fringe}, {"wait-for-wm", &Qwait_for_wm}, {"fullscreen", &Qfullscreen}, + {"decoration", &Qdecoration}, }; #ifdef HAVE_WINDOW_SYSTEM @@ -3273,6 +3277,17 @@ XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; } +void +x_set_decoration (f, arg, oldval) + struct frame *f; + Lisp_Object arg, oldval; +{ + f->decoration = !EQ (Qnil, arg); +#ifdef HAVE_WINDOW_SYSTEM + x_set_frame_decoration(f, f->decoration); +#endif +} + /* Return non-nil if frame F wants a bitmap icon. */