mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-17 19:20:20 +00:00
Replace xtext's transparency with full window transparency
Xtext's transparency barely worked on windows, didn't work on any modern linux wm and used fake transparency. This uses gtk's built in window opacity that works on more systems and is real transparency. Text area only transparency may return with a transition to cairo, if it works on Windows.
This commit is contained in:
@@ -52,10 +52,6 @@
|
||||
#include "urlgrab.h"
|
||||
#include "setup.h"
|
||||
|
||||
#ifdef USE_XLIB
|
||||
#include <gdk/gdkx.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_LIBCANBERRA
|
||||
#include <canberra.h>
|
||||
#endif
|
||||
@@ -66,49 +62,6 @@ GdkPixmap *channelwin_pix;
|
||||
static ca_context *ca_con;
|
||||
#endif
|
||||
|
||||
#ifdef USE_XLIB
|
||||
|
||||
static void
|
||||
redraw_trans_xtexts (void)
|
||||
{
|
||||
GSList *list = sess_list;
|
||||
session *sess;
|
||||
int done_main = FALSE;
|
||||
|
||||
while (list)
|
||||
{
|
||||
sess = list->data;
|
||||
if (GTK_XTEXT (sess->gui->xtext)->transparent)
|
||||
{
|
||||
if (!sess->gui->is_tab || !done_main)
|
||||
gtk_xtext_refresh (GTK_XTEXT (sess->gui->xtext), 1);
|
||||
if (sess->gui->is_tab)
|
||||
done_main = TRUE;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
root_event_cb (GdkXEvent *xev, GdkEventProperty *event, gpointer data)
|
||||
{
|
||||
static Atom at = None;
|
||||
XEvent *xevent = (XEvent *)xev;
|
||||
|
||||
if (xevent->type == PropertyNotify)
|
||||
{
|
||||
if (at == None)
|
||||
at = XInternAtom (xevent->xproperty.display, "_XROOTPMAP_ID", True);
|
||||
|
||||
if (at == xevent->xproperty.atom)
|
||||
redraw_trans_xtexts ();
|
||||
}
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* === command-line parameter parsing : requires glib 2.6 === */
|
||||
|
||||
static char *arg_cfgdir = NULL;
|
||||
@@ -281,11 +234,6 @@ fe_args (int argc, char *argv[])
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
#ifdef USE_XLIB
|
||||
gdk_window_set_events (gdk_get_default_root_window (), GDK_PROPERTY_CHANGE_MASK);
|
||||
gdk_window_add_filter (gdk_get_default_root_window (), (GdkFilterFunc)root_event_cb, NULL);
|
||||
#endif
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user