Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
462bd30
Fix logging usage
chimosky Jul 31, 2024
2800adf
drop Python 2.3 fallback
a-detiste Oct 6, 2024
bd9616e
Update debian package name
chimosky Dec 19, 2024
0cf8919
Update Gtk and Gdk version to 4.0 and refactor Activity class initial…
MostlyKIGuess Jan 19, 2025
34c2f6c
Update Gdk and Gtk version requirements to 4.0
MostlyKIGuess Jan 19, 2025
0dcd5bb
Refactor Alert and TimeoutIcon classes to use Gtk.Box and update to G…
MostlyKIGuess Jan 19, 2025
68a09fb
Update Gtk version to 4.0 and refactor Icon and EventIcon classes
MostlyKIGuess Jan 19, 2025
a3f9d76
fix deprecated readfp method of configparser
MostlyKIGuess Jan 18, 2025
21f044e
Porting Doc
MostlyKIGuess Jan 20, 2025
bbb2aeb
Update porting documentation and migrate Makefile to Gtk 4.0
MostlyKIGuess Jan 21, 2025
c89c017
Update Makefile.am to use Gdk 4.0 for SugarExt and SugarGestures
MostlyKIGuess Jan 21, 2025
b25c3a9
Update porting documentation to include build dependencies for GTK 4.…
MostlyKIGuess Jan 21, 2025
bb75de2
include header fix for gdk
MostlyKIGuess Jan 21, 2025
2b92135
Refactor Gdk includes to simplify header management for X11 windowing
MostlyKIGuess Jan 21, 2025
3bcbc35
feat: Update PaletteWindow to use GTK4 APIs
MostlyKIGuess Jan 22, 2025
4893c02
feat: Port PaletteMenu to GTK4
MostlyKIGuess Jan 22, 2025
3c7c197
feat: Port Palette to GTK4
MostlyKIGuess Jan 22, 2025
2a6e50d
fix: EventBox Replaced with Box
MostlyKIGuess Jan 22, 2025
069097e
feat: Port Palette to GTK4
MostlyKIGuess Jan 22, 2025
2a75044
feat: Port ToolButton to GTK4
MostlyKIGuess Jan 22, 2025
4d0dd00
feat: Replace VBox and HBox with Box in alert, window, toolbox, and t…
MostlyKIGuess Jan 22, 2025
2cae903
Port Alert to GTK4
MostlyKIGuess Jan 22, 2025
56e9f99
feat: Migrate from HBox to Box in Notebook, RadioPalette, RadioToolBu…
MostlyKIGuess Jan 22, 2025
52580b5
feat : Port widgets to GTK4
MostlyKIGuess Jan 22, 2025
18b931a
feat: Update icon theme search path to use display-specific settings
MostlyKIGuess Jan 22, 2025
bedf3b7
feat: Remove button images setting from activity class
MostlyKIGuess Jan 22, 2025
9cc81d7
fix: Update window state event connection to use notify signal
MostlyKIGuess Jan 22, 2025
722806c
feat: Update screen size change handling to use primary monitor geometry
MostlyKIGuess Jan 22, 2025
5f0b37f
fix: Update monitor retrieval to use surface for accurate geometry ha…
MostlyKIGuess Jan 22, 2025
650739b
feat: Refactor window realization to handle monitor geometry updates
MostlyKIGuess Jan 22, 2025
af2e603
fix: Change window event connection from delete-event to close-request
MostlyKIGuess Jan 22, 2025
d16620b
fix: Update monitor retrieval
MostlyKIGuess Jan 22, 2025
1954f12
gtk4 window to screen method
MostlyKIGuess Jan 22, 2025
9b4b577
fix: Update Activity class initialization to use Gtk.Window.__init__()
MostlyKIGuess Jan 25, 2025
c4e1320
fix: Replace Gtk.Toolbar with Gtk.Box in ToolbarBox class
MostlyKIGuess Jan 27, 2025
6079350
fix: Refactor remove callback in ToolbarBox class and add custom remo…
MostlyKIGuess Jan 27, 2025
48caa1c
fix: Introduce _override_background_color function
MostlyKIGuess Jan 27, 2025
011e4f6
fixcolor handling in ToolbarBox and add RGBA parsing
MostlyKIGuess Jan 27, 2025
a914e65
fix: Enhance TitleEntry with focus handling and click gesture support
MostlyKIGuess Jan 27, 2025
ef7aa1d
fix: Improve pointer position retrieval and enhance widget event conn…
MostlyKIGuess Jan 31, 2025
6dccfc2
Update Sugar Toolkit components for full GTK4 compatibility
MostlyKIGuess Feb 3, 2025
9f65093
fix: Update X11 handling in Activity class for GTK4 compatibility
MostlyKIGuess Feb 3, 2025
db68172
fix: Improve item management and event handling in PaletteWindow and …
MostlyKIGuess Feb 5, 2025
c1425b4
Merge branch 'sugarlabs:master' into gtk4
MostlyKIGuess Feb 5, 2025
be94f14
fix: file parsing in ActivityBundle for better compatibility
MostlyKIGuess Feb 5, 2025
e130173
fix: update cursor and gesture grabber to use GdkSurface
MostlyKIGuess Feb 10, 2025
c5ff7bb
Port Sugar toolkit from GTK3 to GTK4 in C
MostlyKIGuess Feb 11, 2025
a83daa7
egg_accelerator changes
MostlyKIGuess Feb 11, 2025
b0878d9
feat: enhance touch event handling with GdkSurface integration
MostlyKIGuess Feb 11, 2025
421635d
fix: update display handling to use GdkDisplay
MostlyKIGuess Feb 11, 2025
9e38c7b
fix: improve activity instance handling and metadata management in da…
MostlyKIGuess Feb 12, 2025
c7e612c
fix: improve title entry handling and adjust alert box margins for be…
MostlyKIGuess Feb 12, 2025
06aa51f
title saving fix
MostlyKIGuess Feb 12, 2025
245eff9
Replace deprecated GTK API calls and update WidgetInvoker click callb…
MostlyKIGuess Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ desktop](https://github.com/sugarlabs/sugar).
To install Sugar Toolkit alone without Sugar desktop,

```
sudo apt install python-sugar3
sudo apt install python3-sugar3
```

Installing on Fedora
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AS_IF([test "x$with_python3" != xno],
[AM_PATH_PYTHON([3])],
[AS_IF([test "x$with_python2" = xyes], [AM_PATH_PYTHON([2.7])],)])

PKG_CHECK_MODULES(EXT, gtk+-3.0 gdk-3.0 gdk-pixbuf-2.0 sm ice alsa
PKG_CHECK_MODULES(EXT, gtk4 gdk-pixbuf-2.0 sm ice alsa
librsvg-2.0 xfixes xi x11)

GLIB_MKENUMS=`$PKG_CONFIG glib-2.0 --variable=glib_mkenums`
Expand Down
111 changes: 111 additions & 0 deletions portingGTK4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Setting Up a Virtual Environment and Running from Source

## Creating a Virtual Environment

1. Open a terminal.
2. Navigate to your project directory:
3. Create a virtual environment:
```sh
python3 -m venv venv
```
4. Activate the virtual environment:
- On Linux/macOS:
```sh
source venv/bin/activate
```
- On Windows:
```sh
.\venv\Scripts\activate
```

## Installing Dependencies

1. Ensure you have `pip` installed. If not, install it:
```sh
python3 -m ensurepip --upgrade
```

## Setting the PYTHONPATH

1. Set the `PYTHONPATH` to include the `src` directory:
```sh
export PYTHONPATH=$(pwd)/src
```

## Running from Source

1. Ensure the virtual environment is activated.
2. Run the application:
```sh
python path/to/your/main_script.py
```

## Deactivating the Virtual Environment

1. When you are done, deactivate the virtual environment:
```sh
deactivate
```




## Porting to GTK 4.0

### Changes Made

1. **Updated `gi.require_version` Calls:**
- Changed `'Gtk', '3.0'` and `'Gdk', '3.0'` to `'Gtk', '4.0'` and `'Gdk', '4.0'` respectively.

2. **Refactored Deprecated GTK 3.0 APIs:**
- Replaced `Gtk.VBox` and `Gtk.HBox` with `Gtk.Box` using orientation.
- Removed `Gtk.EventBox` and implemented event controllers.

3. **Refactored Icon and EventIcon Classes:**
- Updated the `Icon` and `EventIcon` classes to be compatible with GTK 4.0.

4. **Refactored Alert and TimeoutIcon Classes:**
- Modified the `Alert` and `TimeoutIcon` classes to use `Gtk.Box` and updated them to GTK 4.0.

5. **Updated Version Requirements:**
- Changed the GDK and GTK version requirements to 4.0 in the project configuration files.

6. **Refactored Activity Class Initialization:**
- Updated the initialization process of the `Activity` class to be compatible with GTK 4.0.


## Installing Build Dependencies
### On Debian/Ubuntu:
```bash
sudo apt-get install \
build-essential \
python3-dev \
libgtk-4-dev \
libgdk-pixbuf-2.0-dev \
gobject-introspection \
libgirepository1.0-dev \
gir1.2-gtk-4.0 \
python3-gi \
libx11-dev \
libxi-dev \
libxext-dev \
libxrandr-dev \
libxrender-dev \
libxtst-dev \
autoconf \
automake \
libtool \
libasound2-dev \
librsvg2-dev \
```

- If using Debian 11 (Bullseye):
- Add backports to /etc/apt/sources.list:
```bash
sudo echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list
```
-Update and install from backports:
```
sudo apt update
sudo apt -t bullseye-backports install libgtk-4-dev
```
4 changes: 2 additions & 2 deletions src/sugar3/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ SugarExt_1_0_gir_FILES = \
sugar-wm.h

SugarExt_1_0_gir: libsugarext.la
SugarExt_1_0_gir_INCLUDES = Gtk-3.0 Gdk-3.0
SugarExt_1_0_gir_PACKAGES = gtk+-3.0 gdk-3.0
SugarExt_1_0_gir_INCLUDES = Gtk-4.0
SugarExt_1_0_gir_PACKAGES = gtk4
SugarExt_1_0_gir_EXPORT_PACKAGES = SugarExt-1.0

girdir = $(datadir)/gir-1.0
Expand Down
Loading
Loading