[Pkg-wmaker-commits] [wmstickynotes] 32/81: Revert and fix wmhints stuff so that it will withdraw properly.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Tue Aug 25 02:33:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmstickynotes.
commit 8cee2a36cc4b4903541d73367e0bfbc74c5ddfb4
Author: hnc <hnc at 7fc852e4-12a7-4f5b-bad7-374d67da4d19>
Date: Wed Apr 20 00:25:31 2011 +0000
Revert and fix wmhints stuff so that it will withdraw properly.
git-svn-id: svn://svn.code.sf.net/p/wmstickynotes/code@16 7fc852e4-12a7-4f5b-bad7-374d67da4d19
---
wmstickynotes.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/wmstickynotes.c b/wmstickynotes.c
index ccddd45..dc73dae 100644
--- a/wmstickynotes.c
+++ b/wmstickynotes.c
@@ -25,7 +25,6 @@
#include <X11/Xlib.h>
#include <X11/extensions/shape.h>
-#include <X11/Xatom.h>
GdkColormap *colormap;
@@ -36,8 +35,7 @@ long int highest_note_id = 0;
/* The current note that the popup menu was shown for */
Note *current_note;
-GtkWidget *main_window;
-GtkWidget *icon_window;
+
void usage()
{
@@ -52,9 +50,9 @@ void usage()
int main(int argc, char *argv[])
{
GtkWidget *window;
- GtkWidget *icon;
+ GtkWidget *box;
GdkColor color;
- XWMHints wmhints;
+ XWMHints mywmhints;
GtkWidget *main_button;
GdkPixmap *main_button_pixmap;
GdkBitmap *main_button_mask;
@@ -133,17 +131,19 @@ int main(int argc, char *argv[])
colormap = gdk_colormap_new(gdk_visual_get_system(), TRUE);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- //gtk_window_set_default_size(GTK_WINDOW(window), 0, 0);
- gtk_window_move(GTK_WINDOW(window), -100, -100);
+ gtk_window_set_default_size(GTK_WINDOW(window), 64, 64);
+
+ box = gtk_event_box_new();
+ gtk_container_add(GTK_CONTAINER (window), box);
- icon = gtk_event_box_new();
- gtk_container_add(GTK_CONTAINER(window), icon);
+ gdk_color_parse ("#fafafa", &color);
+ gtk_widget_modify_bg(box, GTK_STATE_NORMAL, &color);
main_button_pixmap = gdk_pixmap_colormap_create_from_xpm_d(NULL, colormap, &main_button_mask, NULL, wmstickynotes_xpm);
main_button = gtk_image_new_from_pixmap(main_button_pixmap, main_button_mask);
main_button_box = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(main_button_box), main_button);
- gtk_container_add(GTK_CONTAINER(icon), main_button_box);
+ gtk_container_add(GTK_CONTAINER(box), main_button_box);
color_menu = gtk_menu_new();
@@ -169,8 +169,10 @@ int main(int argc, char *argv[])
gtk_widget_show_all(GTK_WIDGET(color_menu));
gtk_widget_show_all(window);
- gdk_window_set_icon(GDK_WINDOW(window->window), GDK_WINDOW(icon->window), NULL, NULL);
- gdk_window_set_group(GDK_WINDOW(window->window), GDK_WINDOW(window->window));
+ mywmhints.initial_state = WithdrawnState;
+ mywmhints.flags = StateHint;
+
+ XSetWMHints(GDK_WINDOW_XDISPLAY(window->window), GDK_WINDOW_XWINDOW(window->window), &mywmhints);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(G_OBJECT(main_button_box), "button-press-event", G_CALLBACK(main_button_pressed), color_menu);
@@ -268,7 +270,6 @@ void create_note(Note *old_note, ColorScheme *scheme)
GdkPixmap *resize_button_pixmap;
GdkBitmap *resize_button_mask;
GtkTextBuffer *text_buffer;
- XWMHints wmhints;
Note *note;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmstickynotes.git
More information about the Pkg-wmaker-commits
mailing list