Bug#967256: apwal: depends on deprecated GTK 2

2023-12-06 Thread Alexandre Detiste
Hi,

Can this old GTK2 application _launcher_ be removed from Debian ?

Remaining users would miss very little functionality, it's not an app in itself,
just a launcher. (popcon = 42)

Nice screenshots http://apwal.free.fr/
but ... "Debian is not a museum"

Greetings,



Bug#967256: apwal: depends on deprecated GTK 2

2023-12-06 Thread Bastian Germann

Am 06.12.23 um 13:15 schrieb Alexandre Detiste:

Can this old GTK2 application_launcher_  be removed from Debian ?


I would like to second this suggestion.



Bug#967256: apwal: depends on deprecated GTK 2

2024-01-18 Thread Yavor Doganov
Control: tags -1 + patch

Please find attached a patch.
(You might want to remove the last line from debian/rules to create a
dbgsym package.)
Description: Port to GTK 3.
Bug-Debian: https://bugs.debian.org/967256
Author: Yavor Doganov 
Forwarded: no
Last-Update: 2024-01-19
---

--- apwal-0.4.5.orig/src/Makefile
+++ apwal-0.4.5/src/Makefile
@@ -7,11 +7,11 @@
 INSTALL ?= install
 
 ifdef APWAL_DEBUG
-CFLAGS += -g -Wall -Werror `$(PKG_CONFIG) --cflags gtk+-2.0 gthread-2.0 
libxml-2.0` -DGTK_DISABLE_DEPRECATED -DAPWAL_DEBUG $(CPPFLAGS)
-LDFLAGS += `$(PKG_CONFIG) --libs gtk+-2.0 gthread-2.0 libxml-2.0`
+CFLAGS +=  -DAPWAL_DEBUG $(CPPFLAGS) -g -Wall -Werror `$(PKG_CONFIG) --cflags 
gtk+-3.0 gthread-2.0 libxml-2.0`
+LDFLAGS += `$(PKG_CONFIG) --libs gtk+-3.0 gthread-2.0 libxml-2.0`
 else
-CFLAGS += -O2 `$(PKG_CONFIG) --cflags gtk+-2.0 gthread-2.0 libxml-2.0` 
$(CPPFLAGS)
-LDFLAGS += -O2 `$(PKG_CONFIG) --libs gtk+-2.0 gthread-2.0 libxml-2.0`
+CFLAGS += $(CPPFLAGS) -O2 `$(PKG_CONFIG) --cflags gtk+-3.0 gthread-2.0 
libxml-2.0`
+LDFLAGS += -O2 `$(PKG_CONFIG) --libs gtk+-3.0 gthread-2.0 libxml-2.0`
 endif
 
 OBJS=main.o app.o launcher.o editor.o property.o \
@@ -34,7 +34,6 @@
 all: apwal
 apwal: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
-   $(STRIP) $@
 endif
 
 install: all
@@ -42,14 +41,14 @@
$(INSTALL) apwal $(DESTDIR)/usr/bin
 
 .c.o: $(INCS)
-   $(CC) -c $< -o $*.o $(CFLAGS)
+   $(CC) $(CFLAGS) -c $< -o $*.o
 
 xmlrc.o: xmlrc.c $(INCS)
-   $(CC) -c $< -o $*.o $(CFLAGS)
+   $(CC) $(CFLAGS) -c $< -o $*.o
 about.o: about.c $(INCS) ../Makefile.inc
-   $(CC) -c $< -o $*.o $(CFLAGS) -DAPWAL_VERSION=\"$(VERS)\"
+   $(CC) -DAPWAL_VERSION=\"$(VERS)\" $(CFLAGS) -c $< -o $*.o
 
-gtkstuff.o: pixbufinline.inc
+gtkstuff.o: pixbufinline.inc gresource.c
 xmlrc.o: xmlrcinline.inc
 
 $(OBJS): $(INCS)
@@ -88,6 +87,18 @@
echo   "sizeof(pixbufinline_t));" >> $@; \
echo "" >> $@;
 
+gresource.c: ../pixmaps/*.png
+   @echo "generating $@..."
+   @echo "" >> $*.xml
+   @echo "" >> $*.xml
+   @echo "" >> $*.xml
+   @for f in ../pixmaps/*.png; do \
+ echo "$$f" >> $*.xml; \
+   done;
+   @echo "" >> $*.xml
+   @echo "" >> $*.xml
+   @glib-compile-resources --generate-source $*.xml
+
 tags: $(INCS) $(OBJS:.o=.c)
ctags -R
 
@@ -102,5 +113,5 @@

 
 clean:
-   -rm -f $(OBJS) apwal pixbufinline.inc xmlrcinline.inc tags
+   -rm -f $(OBJS) apwal pixbufinline.inc gresource.* xmlrcinline.inc tags
 
--- apwal-0.4.5.orig/src/apwalapp.h
+++ apwal-0.4.5/src/apwalapp.h
@@ -49,9 +49,6 @@
   GtkWidget   *w2_btn_cancel;
   GtkWidget   *w2_btn_ok;
 
-  
-  GtkTooltips  *tips;
-
   struct apwal_pref_t *apwal_pref;
   struct editor_t *editor;
   struct property_t   *prop;
--- apwal-0.4.5.orig/src/launcher.h
+++ apwal-0.4.5/src/launcher.h
@@ -35,7 +35,6 @@
   GtkWidget *event_box;
   GtkWidget *image;
   GdkPixbuf *pixbuf;
-  GdkBitmap *bitmap_mask;
 
   gint   x;
   gint   y;
--- apwal-0.4.5.orig/src/launcher.c
+++ apwal-0.4.5/src/launcher.c
@@ -29,6 +29,7 @@
 {
   launcher_t  *l;
   app_list_t *apps;
+  GdkRectangle geom;
 
   l = (launcher_t *)malloc(sizeof(launcher_t));
   g_assert(l != NULL);
@@ -51,7 +52,6 @@
 
   l->image = NULL;
   l->pixbuf = NULL;
-  l->bitmap_mask = NULL;
 
   l->x = 0;
   l->y = 0;
@@ -60,8 +60,10 @@
 
   l->editor_started = FALSE;
 
-  l->xwidth = gdk_screen_width();
-  l->xheight = gdk_screen_height();
+  gdk_monitor_get_geometry(gdk_display_get_primary_monitor
+   (gdk_display_get_default()), &geom);
+  l->xwidth = geom.width;
+  l->xheight = geom.height;
 
   l->timeout_activated = 0;
   l->apps = NULL;
@@ -75,6 +77,10 @@
 void launcher_load_apps(launcher_t *l, app_list_t *apps)
 {
   app_t *app;
+  cairo_surface_t *surf;
+  cairo_region_t *region;
+  GdkWindow *win;
+  GdkSeat *seat;
   GdkPixbuf *pixbuf;
   GdkModifierType state;// mouse state
   gint x_min, y_min;
@@ -93,7 +99,6 @@
 
   l->pixbuf = NULL;
   l->image = NULL;
-  l->bitmap_mask = NULL;
 
   l->apps = apps;
   if (!apps)
@@ -107,7 +112,11 @@
  app_list_delta_x(l->apps), app_list_delta_y(l->apps),
  x_min, y_min); 
   // get the current position of the mouse cursor
-  gdk_window_get_pointer (l->window->window, &l->x, &l->y, &state);
+  gtk_widget_realize(l->window);
+  seat = gdk_display_get_default_seat(gdk_display_get_default());
+  win = gtk_widget_get_window(l->window);
+  gdk_window_get_device_position(win, gdk_seat_get_pointer(seat),
+ &l->x, &l->y, &state);
   // check if the position is correct
   l->x = l->x + (x_min * ICON_WIDTH);
   if (l->x < 0)
@@ -149,15 +158,19 @@
 app = app_list_next(l->apps);
   }
 
-  gdk_pixbuf_render_pixmap_and_mask(l->pixbuf,
-NULL/*pixmap_return*/,
-&l->bitmap_mask/*mask_return*/,
-