unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* frame sans decoration
@ 2005-05-26 19:02 Masatake YAMATO
  2005-05-26 20:27 ` David Kastrup
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Masatake YAMATO @ 2005-05-26 19:02 UTC (permalink / raw)
  Cc: zappo

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
+}
+
+
 \f
 /***********************************************************************
 				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.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: frame sans decoration
  2005-05-26 19:02 frame sans decoration Masatake YAMATO
@ 2005-05-26 20:27 ` David Kastrup
  2005-05-26 21:01 ` Lennart Borgman
  2005-05-26 22:59 ` Juanma Barranquero
  2 siblings, 0 replies; 4+ messages in thread
From: David Kastrup @ 2005-05-26 20:27 UTC (permalink / raw)
  Cc: zappo, emacs-devel

Masatake YAMATO <jet@gyve.org> writes:

> 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.

Disagree.

> 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,

A tooltip is exactly there for the purpose of _not_ interfering with
input.  And it is actually close to impossible to move the mouse
cursor _onto_ a tooltip.

> (2) you can use text with faces and pixmap images, and

You can do that already.

> (3) you can contorol the text with faces and pixmap images with
> elisp code.

You can do that already.

> (4) scrollbar

Since it is not possible to move the mouse cursor onto a tooltip
window, there does not seem much purpose in doing so.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: frame sans decoration
  2005-05-26 19:02 frame sans decoration Masatake YAMATO
  2005-05-26 20:27 ` David Kastrup
@ 2005-05-26 21:01 ` Lennart Borgman
  2005-05-26 22:59 ` Juanma Barranquero
  2 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2005-05-26 21:01 UTC (permalink / raw)
  Cc: zappo, emacs-devel

Masatake YAMATO wrote:

>With this patch, you can use a frame as a tooltip window.
>Advantages over the conventional tooltip window are:
>  
>
There is something I do not understand here. Is not the tooltip window 
already a frame in Emacs?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: frame sans decoration
  2005-05-26 19:02 frame sans decoration Masatake YAMATO
  2005-05-26 20:27 ` David Kastrup
  2005-05-26 21:01 ` Lennart Borgman
@ 2005-05-26 22:59 ` Juanma Barranquero
  2 siblings, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2005-05-26 22:59 UTC (permalink / raw)


On 5/26/05, Masatake YAMATO <jet@gyve.org> wrote:

> I know well that we are in feature-freeze stage.
> However [...]

Don't all feature authors feel likewise?

-- 
                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-26 22:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-26 19:02 frame sans decoration Masatake YAMATO
2005-05-26 20:27 ` David Kastrup
2005-05-26 21:01 ` Lennart Borgman
2005-05-26 22:59 ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).